about summary refs log tree commit diff
path: root/src/math/scalbnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/scalbnl.c')
-rw-r--r--src/math/scalbnl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/scalbnl.c b/src/math/scalbnl.c
index 08a4c587..db44dab0 100644
--- a/src/math/scalbnl.c
+++ b/src/math/scalbnl.c
@@ -20,11 +20,11 @@ long double scalbnl(long double x, int n)
 				n = 16383;
 		}
 	} else if (n < -16382) {
-		x *= 0x1p-16382L;
-		n += 16382;
+		x *= 0x1p-16382L * 0x1p113L;
+		n += 16382 - 113;
 		if (n < -16382) {
-			x *= 0x1p-16382L;
-			n += 16382;
+			x *= 0x1p-16382L * 0x1p113L;
+			n += 16382 - 113;
 			if (n < -16382)
 				n = -16382;
 		}