Lines Matching refs:Fraction
60 class Fraction(numbers.Rational): class
115 self = super(Fraction, cls).__new__(cls)
254 return Fraction(self)
267 bound1 = Fraction(p0+k*p1, q0+k*q1)
268 bound2 = Fraction(p1, q1)
375 if isinstance(b, (int, Fraction)):
404 return Fraction(a.numerator * db + b.numerator * da,
412 return Fraction(a.numerator * db - b.numerator * da,
419 return Fraction(a.numerator * b.numerator, a.denominator * b.denominator)
425 return Fraction(a.numerator * b.denominator,
460 return Fraction(a._numerator ** power,
464 return Fraction(a._denominator ** -power,
468 return Fraction((-a._denominator) ** -power,
485 return Fraction(a.numerator, a.denominator) ** b
494 return Fraction(a._numerator, a._denominator, _normalize=False)
498 return Fraction(-a._numerator, a._denominator, _normalize=False)
502 return Fraction(abs(a._numerator), a._denominator, _normalize=False)
541 return Fraction(round(self * shift), shift)
543 return Fraction(round(self / shift) * shift)
636 if type(self) == Fraction:
641 if type(self) == Fraction: