cutcutcodec.utils.mround

cutcutcodec.utils.mround(number: Real, nbits: int = 8) float[source]

Round the mentissa of a floating number.

Parameters

number: float

The number to be rounded.

nbits: int, default=4

The number of bit to keep in the mantissa.

Returns

float

The rounded number.

Examples

>>> from cutcutcodec.utils import mround
>>> mround(1/3)
0.333984375
>>>