odc.geo.math.split_float

odc.geo.math.split_float(x)[source]

Split float number into whole and fractional parts.

Adding the two numbers back together should result in the original value. Fractional part is always in the (-0.5, +0.5) interval, and whole part is equivalent to round(x).

Parameters:

x (float) – floating point number

Return type:

Tuple[float, float]

Returns:

whole, fraction