From 9e6c74cd9f4a376abe17e4f420520b5ad3743b81 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 10:02:43 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- divide_and_conquer/power.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/divide_and_conquer/power.py b/divide_and_conquer/power.py index 4f96bbb66..5a054b074 100644 --- a/divide_and_conquer/power.py +++ b/divide_and_conquer/power.py @@ -26,6 +26,7 @@ def actual_power(a: int, b: int): else: return half * half + def power(a: int, b: int) -> float: """ :param a: The base (integer). @@ -33,8 +34,9 @@ def power(a: int, b: int) -> float: :return: The result of a^b, as a float for negative exponents. """ if b < 0: - return 1 / actual_power(a, -b) + return 1 / actual_power(a, -b) return actual_power(a, b) + if __name__ == "__main__": - print(power(-2, -3)) #output -0.125 + print(power(-2, -3)) # output -0.125