From c98edf25e40febc1d7c63e934fb1ee7e2f3d2195 Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Fri, 19 Jan 2024 01:49:58 +0100 Subject: [PATCH] Added potentiate functionality and test --- src/main/py/logarithmic_and_expo_and_root_calculations.py | 4 ++++ src/test/py/logarithmic_ann_expo_and_root_calculations.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/main/py/logarithmic_and_expo_and_root_calculations.py b/src/main/py/logarithmic_and_expo_and_root_calculations.py index 087e88f..3abab62 100644 --- a/src/main/py/logarithmic_and_expo_and_root_calculations.py +++ b/src/main/py/logarithmic_and_expo_and_root_calculations.py @@ -3,3 +3,7 @@ import math def sqrt(first_number): return math.sqrt(first_number) + + +def potentiate(first_number, second_number): + return math.pow(first_number, second_number) diff --git a/src/test/py/logarithmic_ann_expo_and_root_calculations.py b/src/test/py/logarithmic_ann_expo_and_root_calculations.py index 3ebeaf7..2778afe 100644 --- a/src/test/py/logarithmic_ann_expo_and_root_calculations.py +++ b/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): self.assertEqual(sqrt(4), 2) + def test_2_potentiate_3_equals_8(self): + self.assertEqual(potentiate(2, 3), 8) + if __name__ == "__main__": unittest.main()