Browse Source

Added potentiate functionality and test

remotes/origin/feature/feature-fractions
fdai7783 11 months ago
committed by fdai7764
parent
commit
c98edf25e4
  1. 4
      src/main/py/logarithmic_and_expo_and_root_calculations.py
  2. 3
      src/test/py/logarithmic_ann_expo_and_root_calculations.py

4
src/main/py/logarithmic_and_expo_and_root_calculations.py

@ -3,3 +3,7 @@ import math
def sqrt(first_number): def sqrt(first_number):
return math.sqrt(first_number) return math.sqrt(first_number)
def potentiate(first_number, second_number):
return math.pow(first_number, second_number)

3
src/test/py/logarithmic_ann_expo_and_root_calculations.py

@ -12,6 +12,9 @@ class primitive_calculations(unittest.TestCase):
def test_sqrt_of_4_equals_2(self): def test_sqrt_of_4_equals_2(self):
self.assertEqual(sqrt(4), 2) self.assertEqual(sqrt(4), 2)
def test_2_potentiate_3_equals_8(self):
self.assertEqual(potentiate(2, 3), 8)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Loading…
Cancel
Save