From a8178146de613fbf5d9b0ad9dbb1cbb0197e2e83 Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Fri, 19 Jan 2024 02:15:15 +0100 Subject: [PATCH] Added functionality to logarithmize with base10 --- 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 dc181e1..98c53f4 100644 --- a/src/main/py/logarithmic_and_expo_and_root_calculations.py +++ b/src/main/py/logarithmic_and_expo_and_root_calculations.py @@ -15,3 +15,7 @@ def logarithmize(first_number, second_number): def logarithmize_dualis(first_number): return math.log2(first_number) + + +def logarithmize_base_10(number): + return math.log10(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 930ed0c..2a9594e 100644 --- a/src/test/py/logarithmic_ann_expo_and_root_calculations.py +++ b/src/test/py/logarithmic_ann_expo_and_root_calculations.py @@ -21,6 +21,9 @@ class primitive_calculations(unittest.TestCase): def test_4_ld_equals_2(self): self.assertEqual(logarithmize_dualis(4), 2) + def test_10_log10_equals_1(self): + self.assertEqual(logarithmize_base_10(10), 1) + if __name__ == "__main__": unittest.main()