Browse Source

refactoring: Avoided Duplication of Code in Function frac_to_dec by utilizing the already implemented functions

remotes/origin/feature/feature-fractions
fdai7764 11 months ago
parent
commit
b5501ee24e
  1. 3
      src/main/py/fractions.py

3
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()

Loading…
Cancel
Save