MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _mul

Method _mul

tools/python-3.11.9-amd64/Lib/fractions.py:484–496  ·  view source on GitHub ↗

a * b

(a, b)

Source from the content-addressed store, hash-verified

482 __sub__, __rsub__ = _operator_fallbacks(_sub, operator.sub)
483
484 def _mul(a, b):
485 """a * b"""
486 na, da = a.numerator, a.denominator
487 nb, db = b.numerator, b.denominator
488 g1 = math.gcd(na, db)
489 if g1 > 1:
490 na //= g1
491 db //= g1
492 g2 = math.gcd(nb, da)
493 if g2 > 1:
494 nb //= g2
495 da //= g2
496 return Fraction(na * nb, db * da, _normalize=False)
497
498 __mul__, __rmul__ = _operator_fallbacks(_mul, operator.mul)
499

Callers

nothing calls this directly

Calls 1

FractionClass · 0.85

Tested by

no test coverage detected