MCPcopy Index your code
hub / github.com/python/cpython / as_integer_ratio

Method as_integer_ratio

Lib/fractions.py:377–382  ·  view source on GitHub ↗

Return a pair of integers, whose ratio is equal to the original Fraction. The ratio is in lowest terms and has a positive denominator.

(self)

Source from the content-addressed store, hash-verified

375 return self._denominator == 1
376
377 def as_integer_ratio(self):
378 """Return a pair of integers, whose ratio is equal to the original Fraction.
379
380 The ratio is in lowest terms and has a positive denominator.
381 """
382 return (self._numerator, self._denominator)
383
384 def limit_denominator(self, max_denominator=1000000):
385 """Closest Fraction to self with denominator at most max_denominator.

Callers 7

__mul__Method · 0.45
__truediv__Method · 0.45
_exact_ratioFunction · 0.45
_decimal_sqrt_of_fracFunction · 0.45
__new__Method · 0.45
from_numberMethod · 0.45
from_floatMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected