diff options
author | nsz <nsz@port70.net> | 2012-03-19 23:39:47 +0100 |
---|---|---|
committer | nsz <nsz@port70.net> | 2012-03-19 23:39:47 +0100 |
commit | b03255af77776703c8d48819e824d09f6f54ba86 (patch) | |
tree | c453bc7c5b4bcdbc572e8667a86ec6f2e3f09e49 /src/math/remainder.c | |
parent | 4caa17b2a17d136efedfb63fceef832401063d70 (diff) | |
download | musl-b03255af77776703c8d48819e824d09f6f54ba86.tar.gz musl-b03255af77776703c8d48819e824d09f6f54ba86.tar.bz2 musl-b03255af77776703c8d48819e824d09f6f54ba86.tar.xz musl-b03255af77776703c8d48819e824d09f6f54ba86.zip |
fix remainder*.c: remove useless long double cast
Diffstat (limited to 'src/math/remainder.c')
-rw-r--r-- | src/math/remainder.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/math/remainder.c b/src/math/remainder.c index db176c88..2dede3a8 100644 --- a/src/math/remainder.c +++ b/src/math/remainder.c @@ -20,8 +20,6 @@ #include "libm.h" -static const double zero = 0.0; - double remainder(double x, double p) { int32_t hx,hp; @@ -35,17 +33,15 @@ double remainder(double x, double p) hx &= 0x7fffffff; /* purge off exception values */ - if ((hp|lp) == 0) /* p = 0 */ - return (x*p)/(x*p); - if (hx >= 0x7ff00000 || /* x not finite */ + if ((hp|lp) == 0 || /* p = 0 */ + hx >= 0x7ff00000 || /* x not finite */ (hp >= 0x7ff00000 && (hp-0x7ff00000 | lp) != 0)) /* p is NaN */ - // FIXME: why long double? - return ((long double)x*p)/((long double)x*p); + return (x*p)/(x*p); if (hp <= 0x7fdfffff) x = fmod(x, p+p); /* now x < 2p */ if (((hx-hp)|(lx-lp)) == 0) - return zero*x; + return 0.0*x; x = fabs(x); p = fabs(p); if (hp < 0x00200000) { |