bit_truncate_double#

caput.util.truncate.bit_truncate_double(val: numpy.float64, err: numpy.float64) numpy.float64[source]#

Truncate using a fixed error.

Parameters:
valfloat

The value to truncate.

errfloat

The absolute precision to allow.

Returns:
truncatedfloat

The truncated value.

Raises:
ValueError

If err is a NaN.