Browse Source

Added functionality to logarithmize with base10

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

@ -15,3 +15,7 @@ def logarithmize(first_number, second_number):
def logarithmize_dualis(first_number): def logarithmize_dualis(first_number):
return math.log2(first_number) return math.log2(first_number)
def logarithmize_base_10(number):
return math.log10(number)

3
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): def test_4_ld_equals_2(self):
self.assertEqual(logarithmize_dualis(4), 2) self.assertEqual(logarithmize_dualis(4), 2)
def test_10_log10_equals_1(self):
self.assertEqual(logarithmize_base_10(10), 1)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Loading…
Cancel
Save