Browse Source

added recognition of zero exponent to instantly return 1 to reduce room for errors

remotes/origin/feature/feature-calculations_with_roots
fdai7764 11 months ago
parent
commit
94da305be0
  1. 2
      src/main/py/calculations_with_roots.py

2
src/main/py/calculations_with_roots.py

@ -8,4 +8,6 @@ def multiplyRoots(first_number, second_number):
def sqrt_power(base, exponent):
if base < 0:
return -1
if exponent == 0:
return 1
return potentiate(sqrt(base), exponent)
Loading…
Cancel
Save