about summary refs log tree commit diff
path: root/src/math/scalbnf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/scalbnf.c')
-rw-r--r--src/math/scalbnf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/scalbnf.c b/src/math/scalbnf.c
index 0b62c3c7..a5ad208b 100644
--- a/src/math/scalbnf.c
+++ b/src/math/scalbnf.c
@@ -16,11 +16,11 @@ float scalbnf(float x, int n)
 				n = 127;
 		}
 	} else if (n < -126) {
-		y *= 0x1p-126f;
-		n += 126;
+		y *= 0x1p-126f * 0x1p24f;
+		n += 126 - 24;
 		if (n < -126) {
-			y *= 0x1p-126f;
-			n += 126;
+			y *= 0x1p-126f * 0x1p24f;
+			n += 126 - 24;
 			if (n < -126)
 				n = -126;
 		}