From e37d0309009f6f23aa25865cc87342430e7fb17e Mon Sep 17 00:00:00 2001 From: BenB Date: Fri, 8 Aug 2025 15:35:59 -0700 Subject: [PATCH] fix rounding issue --- src/gfloat/round.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: