From 60e235ee2ae834bb9f7a884f1b192304b9fdcf33 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 7 Nov 2012 13:03:31 +0000 Subject: Fix spurious underflows from pow with results close to 1 (bug 14811). --- sysdeps/ieee754/flt-32/e_powf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/ieee754/flt-32/e_powf.c') diff --git a/sysdeps/ieee754/flt-32/e_powf.c b/sysdeps/ieee754/flt-32/e_powf.c index 43069479a5..12c408f93c 100644 --- a/sysdeps/ieee754/flt-32/e_powf.c +++ b/sysdeps/ieee754/flt-32/e_powf.c @@ -141,6 +141,10 @@ __ieee754_powf(float x, float y) t2 = v-(t1-u); } else { float s2,s_h,s_l,t_h,t_l; + /* Avoid internal underflow for tiny y. The exact value + of y does not matter if |y| <= 2**-32. */ + if (iy < 0x2f800000) + SET_FLOAT_WORD (y, (hy & 0x80000000) | 0x2f800000); n = 0; /* take care subnormal number */ if(ix<0x00800000) -- cgit 1.4.1