From 29132b91519572e6076003735cd6f718ff2e1369 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 5 Dec 2001 19:19:20 +0000 Subject: Update. * iconvdata/ibm1129.h: Remove duplicate mappings. * iconvdata/ibm937.c: Handle overflow errors. Handle new tables. * iconvdata/ibm937.h: Reorganize table to safe a lot of space. Patch by Masahide Washizawa . * timezone/zic.c: Fix handling of turnaround times. Patch by Arthur David Olson . 2001-12-02 Moshe Olshansky * sysdeps/ieee754/dbl-64/e_remainder.c (__ieee754_remainder): Fix overflow problem. 2001-12-05 Ulrich Drepper * posix/regex.c: For use outside glibc defined bounded pointer macros here. Patch by Jim Meyering . --- sysdeps/ieee754/dbl-64/e_remainder.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sysdeps/ieee754') diff --git a/sysdeps/ieee754/dbl-64/e_remainder.c b/sysdeps/ieee754/dbl-64/e_remainder.c index 9c82ae7..2001321 100644 --- a/sysdeps/ieee754/dbl-64/e_remainder.c +++ b/sysdeps/ieee754/dbl-64/e_remainder.c @@ -55,8 +55,8 @@ double __ieee754_remainder(double x, double y) kx=u.i[HIGH_HALF]&0x7fffffff; /* no sign for x*/ t.i[HIGH_HALF]&=0x7fffffff; /*no sign for y */ ky=t.i[HIGH_HALF]; - /*------ |x| < 2^1024 and 2^-970 < |y| < 2^1024 ------------------*/ - if (kx<0x7ff00000 && ky<0x7ff00000 && ky>=0x03500000) { + /*------ |x| < 2^1023 and 2^-970 < |y| < 2^1024 ------------------*/ + if (kx<0x7fe00000 && ky<0x7ff00000 && ky>=0x03500000) { if (kx+0x00100000=0x03500000) */ + } /* (kx<0x7fe00000&&ky<0x7ff00000&&ky>=0x03500000) */ else { - if (kx<0x7ff00000&&ky<0x7ff00000&&(ky>0||t.i[LOW_HALF]!=0)) { + if (kx<0x7fe00000&&ky<0x7ff00000&&(ky>0||t.i[LOW_HALF]!=0)) { y=ABS(y)*t128.x; z=__ieee754_remainder(x,y)*t128.x; z=__ieee754_remainder(z,y)*tm128.x; return z; } + else { + if ((kx&0x7ff00000)==0x7fe00000&&ky<0x7ff00000&&(ky>0||t.i[LOW_HALF]!=0)) { + y=ABS(y); + z=2.0*__ieee754_remainder(0.5*x,y); + d = ABS(z); + if (d <= ABS(d-y)) return z; + else return (z>0)?z-y:z+y; + } else { /* if x is too big */ if (kx == 0x7ff00000 && u.i[LOW_HALF] == 0 && y == 1.0) return x / x; @@ -116,5 +124,6 @@ double __ieee754_remainder(double x, double y) return (u.i[HIGH_HALF]&0x80000000)?nNAN.x:NAN.x; else return x; } + } } } -- cgit v1.1