From b5501ee24edb61eb72eff709f9f76e4ff6a81377 Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sat, 20 Jan 2024 12:39:29 +0100 Subject: [PATCH] refactoring: Avoided Duplication of Code in Function frac_to_dec by utilizing the already implemented functions --- src/main/py/fractions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/py/fractions.py b/src/main/py/fractions.py index 101f37d..397b9d6 100644 --- a/src/main/py/fractions.py +++ b/src/main/py/fractions.py @@ -1,7 +1,8 @@ from src.main.py.more_advanced_calculations import gcd, lcm +from src.main.py.primitive_calculations import * def frac_to_dec(num, denom): - return num/denom + return divide(num, denom) def dec_to_frac(dec_number): return dec_number.as_integer_ratio()