a * b
(a, b)
| 824 | __sub__, __rsub__ = _operator_fallbacks(_sub, operator.sub) |
| 825 | |
| 826 | def _mul(a, b): |
| 827 | """a * b""" |
| 828 | na, da = a._numerator, a._denominator |
| 829 | nb, db = b._numerator, b._denominator |
| 830 | g1 = math.gcd(na, db) |
| 831 | if g1 > 1: |
| 832 | na //= g1 |
| 833 | db //= g1 |
| 834 | g2 = math.gcd(nb, da) |
| 835 | if g2 > 1: |
| 836 | nb //= g2 |
| 837 | da //= g2 |
| 838 | return Fraction._from_coprime_ints(na * nb, db * da) |
| 839 | |
| 840 | __mul__, __rmul__ = _operator_fallbacks(_mul, operator.mul) |
| 841 |
nothing calls this directly
no test coverage detected