Lines Matching refs:denominator
84 def __new__(cls, numerator=0, denominator=None, *, _normalize=True): argument
117 if denominator is None:
125 self._denominator = numerator.denominator
142 denominator = int(denom)
144 denominator = 1
149 denominator *= scale
156 denominator *= 10**-exp
164 elif type(numerator) is int is type(denominator):
168 isinstance(denominator, numbers.Rational)):
169 numerator, denominator = (
170 numerator.numerator * denominator.denominator,
171 denominator.numerator * numerator.denominator
177 if denominator == 0:
180 if type(numerator) is int is type(denominator):
182 g = math.gcd(numerator, denominator)
183 if denominator < 0:
186 g = _gcd(numerator, denominator)
188 denominator //= g
190 self._denominator = denominator
279 def denominator(a): member in Fraction
403 da, db = a.denominator, b.denominator
411 da, db = a.denominator, b.denominator
419 return Fraction(a.numerator * b.numerator, a.denominator * b.denominator)
425 return Fraction(a.numerator * b.denominator,
426 a.denominator * b.numerator)
457 if b.denominator == 1:
485 return Fraction(a.numerator, a.denominator) ** b
513 return a.numerator // a.denominator
518 return -(-a.numerator // a.denominator)
526 floor, remainder = divmod(self.numerator, self.denominator)
527 if remainder * 2 < self.denominator:
529 elif remainder * 2 > self.denominator:
573 a._denominator == b.denominator)
600 return op(self._numerator * other.denominator,