diff --git a/src/gfloat/round.py b/src/gfloat/round.py index 5509e30..bce6831 100644 --- a/src/gfloat/round.py +++ b/src/gfloat/round.py @@ -73,7 +73,7 @@ def round_float( else: # Extract exponent - expval = int(math.floor(math.log2(vpos))) + expval = math.frexp(vpos)[1] - 1 # Effective precision, accounting for right shift for subnormal values if fi.has_subnormals: