MCPcopy Create free account
hub / github.com/apache/fory / _decimal_from_float_value

Function _decimal_from_float_value

python/pyfory/converter.py:208–211  ·  view source on GitHub ↗
(value: float)

Source from the content-addressed store, hash-verified

206
207
208def _decimal_from_float_value(value: float) -> decimal.Decimal:
209 if value == 0.0:
210 return decimal.Decimal(0)
211 return _canonical_decimal(decimal.Decimal.from_float(value))
212
213
214def _int_value(value, local_type_id: int) -> int:

Callers 2

_float_valueFunction · 0.85
_numeric_valueFunction · 0.85

Calls 3

_canonical_decimalFunction · 0.85
DecimalMethod · 0.45
from_floatMethod · 0.45

Tested by

no test coverage detected