MCPcopy Create free account
hub / github.com/apache/arrow / scaled_float

Function scaled_float

python/pyarrow/tests/test_compute.py:2320–2328  ·  view source on GitHub ↗

Return a float representation (possibly approximate) of `int_val**-scale`

(int_val, scale)

Source from the content-addressed store, hash-verified

2318
2319
2320def scaled_float(int_val, scale):
2321 """
2322 Return a float representation (possibly approximate) of `int_val**-scale`
2323 """
2324 assert isinstance(int_val, int)
2325 unscaled = decimal.Decimal(int_val)
2326 scaled = unscaled.scaleb(-scale)
2327 float_val = float(scaled)
2328 return float_val
2329
2330
2331def integral_float_to_decimal_cast_cases(float_ty, max_precision):

Callers 1

Calls 1

DecimalMethod · 0.45

Tested by

no test coverage detected