diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/msun/src/e_remainder.c | 8 | ||||
-rw-r--r-- | lib/msun/src/e_remainderf.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/msun/src/e_remainder.c b/lib/msun/src/e_remainder.c index 1cea6c1..2d285d6 100644 --- a/lib/msun/src/e_remainder.c +++ b/lib/msun/src/e_remainder.c @@ -11,9 +11,8 @@ * ==================================================== */ -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); /* __ieee754_remainder(x,p) * Return : @@ -48,7 +47,7 @@ __ieee754_remainder(double x, double p) if((hx>=0x7ff00000)|| /* x not finite */ ((hp>=0x7ff00000)&& /* p is NaN */ (((hp-0x7ff00000)|lp)!=0))) - return (x*p)/(x*p); + return ((long double)x*p)/((long double)x*p); if (hp<=0x7fdfffff) x = __ieee754_fmod(x,p+p); /* now x < 2p */ @@ -68,6 +67,7 @@ __ieee754_remainder(double x, double p) } } GET_HIGH_WORD(hx,x); + if ((hx&0x7fffffff)==0) hx = 0; SET_HIGH_WORD(x,hx^sx); return x; } diff --git a/lib/msun/src/e_remainderf.c b/lib/msun/src/e_remainderf.c index 7841bdc..b0014ae 100644 --- a/lib/msun/src/e_remainderf.c +++ b/lib/msun/src/e_remainderf.c @@ -13,9 +13,8 @@ * ==================================================== */ -#ifndef lint -static char rcsid[] = "$FreeBSD$"; -#endif +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" @@ -40,7 +39,7 @@ __ieee754_remainderf(float x, float p) if(hp==0) return (x*p)/(x*p); /* p = 0 */ if((hx>=0x7f800000)|| /* x not finite */ ((hp>0x7f800000))) /* p is NaN */ - return (x*p)/(x*p); + return ((long double)x*p)/((long double)x*p); if (hp<=0x7effffff) x = __ieee754_fmodf(x,p+p); /* now x < 2p */ @@ -60,6 +59,7 @@ __ieee754_remainderf(float x, float p) } } GET_FLOAT_WORD(hx,x); + if ((hx&0x7fffffff)==0) hx = 0; SET_FLOAT_WORD(x,hx^sx); return x; } |