bit_truncate_float#

caput.util.truncate.bit_truncate_float(val: numpy.float32, err: numpy.float32) numpy.float32[source]#

Truncate using a fixed error.

Parameters:
valfloat32

The value to truncate.

errfloat32

The absolute precision to allow.

Returns:
truncatedfloat32

The truncated value.

Raises:
ValueError

If err is a NaN.