ID EN
Fractions

from_float

Python 3.11

Alternative constructor which only accepts instances of float or numbers.Integral. Beware that Fraction.from_float(0.3) is not the same value as Fraction(3, 10).

Syntax

PYTHON
classmethod from_float(flt)

See Also

float numbers.Integral Fraction float