Browse Source

Added logarithmize functionality and test

remotes/origin/feature/feature-fractions
fdai7783 11 months ago
committed by fdai7764
parent
commit
86b4b1e3ce
  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

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

3
src/test/py/logarithmic_ann_expo_and_root_calculations.py

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