From c6383b7b10303457306932584fc23f24b5153a81 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Sun, 16 Dec 2012 20:28:43 +0100 Subject: math: use 0x1p-120f and 0x1p120f for tiny and huge values previously 0x1p-1000 and 0x1p1000 was used for raising inexact exception like x+tiny (when x is big) or x+huge (when x is small) the rational is that these float consts are large enough (0x1p-120 + 1 raises inexact even on ld128 which has 113 mant bits) and float consts maybe smaller or easier to load on some platforms (on i386 this reduced the object file size by 4bytes in some cases) --- src/math/exp2f.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/math/exp2f.c') diff --git a/src/math/exp2f.c b/src/math/exp2f.c index 279f32de..ea50db4a 100644 --- a/src/math/exp2f.c +++ b/src/math/exp2f.c @@ -97,11 +97,11 @@ float exp2f(float x) return x; } if (x >= 128) { - STRICT_ASSIGN(float, x, x * 0x1p127); + STRICT_ASSIGN(float, x, x * 0x1p127f); return x; } if (x <= -150) { - STRICT_ASSIGN(float, x, 0x1p-100*0x1p-100); + STRICT_ASSIGN(float, x, 0x1p-100f*0x1p-100f); return x; } } else if (ix <= 0x33000000) { /* |x| <= 0x1p-25 */ -- cgit v1.2.1