mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-13 01:59:49 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
bcd0b508c3
commit
9e6c74cd9f
@ -26,6 +26,7 @@ def actual_power(a: int, b: int):
|
|||||||
else:
|
else:
|
||||||
return half * half
|
return half * half
|
||||||
|
|
||||||
|
|
||||||
def power(a: int, b: int) -> float:
|
def power(a: int, b: int) -> float:
|
||||||
"""
|
"""
|
||||||
:param a: The base (integer).
|
:param a: The base (integer).
|
||||||
@ -36,5 +37,6 @@ def power(a: int, b: int) -> float:
|
|||||||
return 1 / actual_power(a, -b)
|
return 1 / actual_power(a, -b)
|
||||||
return actual_power(a, b)
|
return actual_power(a, b)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(power(-2, -3)) #output -0.125
|
print(power(-2, -3)) # output -0.125
|
||||||
|
Loading…
x
Reference in New Issue
Block a user