mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-23 01:28:26 +00:00
* Fix And Add power.py To fix the inaccuracies and allow handling of negative exponents and bases, the key issue lies in how negative numbers are handled in the power calculation, especially when dividing. ## Example Output: ```python >>> power(4, 6) 4096 >>> power(2, 3) 8 >>> power(-2, 3) -8 >>> power(2, -3) 0.125 >>> power(-2, -3) -0.125 ``` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update power.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update power.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update power.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update power.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru> |
||
---|---|---|
.. | ||
__init__.py | ||
closest_pair_of_points.py | ||
convex_hull.py | ||
heaps_algorithm_iterative.py | ||
heaps_algorithm.py | ||
inversions.py | ||
kth_order_statistic.py | ||
max_difference_pair.py | ||
max_subarray.py | ||
mergesort.py | ||
peak.py | ||
power.py | ||
strassen_matrix_multiplication.py |