Skip to content

Commit 9e6c74c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent bcd0b50 commit 9e6c74c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

divide_and_conquer/power.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ def actual_power(a: int, b: int):
2626
else:
2727
return half * half
2828

29+
2930
def power(a: int, b: int) -> float:
3031
"""
3132
:param a: The base (integer).
3233
:param b: The exponent (integer).
3334
:return: The result of a^b, as a float for negative exponents.
3435
"""
3536
if b < 0:
36-
return 1 / actual_power(a, -b)
37+
return 1 / actual_power(a, -b)
3738
return actual_power(a, b)
3839

40+
3941
if __name__ == "__main__":
40-
print(power(-2, -3)) #output -0.125
42+
print(power(-2, -3)) # output -0.125

0 commit comments

Comments
 (0)