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

Method from_float

Lib/decimal.py:662–697  ·  view source on GitHub ↗

Converts a float to a decimal number, exactly. Note that Decimal.from_float(0.1) is not the same as Decimal('0.1'). Since 0.1 is not exactly representable in binary floating point, the value is stored as the nearest representable value which is 0x1.999999999999ap-4.

(cls, f)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 4

__new__Method · 0.45
__hash__Method · 0.45
_convert_otherFunction · 0.45

Calls 3

clsClass · 0.85
_dec_from_tripleFunction · 0.85
strFunction · 0.85

Tested by

no test coverage detected