Exemple #1
0
 def lcm_of_denominators(self, start_lcm=1):
     result = start_lcm
     for e in self.n:
         result = rational.lcm(result, rational.int(e).denominator())
     result = rational.lcm(result, rational.int(self.c).denominator())
     return result
Exemple #2
0
 def lcm_of_denominators(self, start_lcm=1):
   result = start_lcm
   for e in self.n:
     result = rational.lcm(result, rational.int(e).denominator())
   result = rational.lcm(result, rational.int(self.c).denominator())
   return result
def exercise_functions():
    assert rational.gcd(8, 6) == 2
    assert rational.lcm(8, 6) == 24
def exercise_functions():
  assert rational.gcd(8,6) == 2
  assert rational.lcm(8,6) == 24