MCPcopy Create free account
hub / github.com/eshirazi/python-with-braces / from_float

Method from_float

Lib/fractions.py:169–182  ·  view source on GitHub ↗

Converts a finite float to a rational number, exactly. Beware that Fraction.from_float(0.3) != Fraction(3, 10).

(cls, f)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

_richcmpMethod · 0.95
__new__Method · 0.45
__eq__Method · 0.45

Calls 1

clsClass · 0.85

Tested by

no test coverage detected