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/remainderf.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/remainderf.c')
-rw-r--r-- | src/math/remainderf.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/math/remainderf.c b/src/math/remainderf.c index 61c3c660..77671039 100644 --- a/src/math/remainderf.c +++ b/src/math/remainderf.c @@ -15,8 +15,6 @@ #include "libm.h" -static const float zero = 0.0; - float remainderf(float x, float p) { int32_t hx,hp; @@ -30,16 +28,13 @@ float remainderf(float x, float p) hx &= 0x7fffffff; /* purge off exception values */ - if (hp == 0) /* p = 0 */ + if (hp == 0 || hx >= 0x7f800000 || hp > 0x7f800000) /* p = 0, x not finite, p is NaN */ return (x*p)/(x*p); - if (hx >= 0x7f800000 || hp > 0x7f800000) /* x not finite, p is NaN */ - // FIXME: why long double? - return ((long double)x*p)/((long double)x*p); if (hp <= 0x7effffff) x = fmodf(x, p + p); /* now x < 2p */ if (hx - hp == 0) - return zero*x; + return 0.0f*x; x = fabsf(x); p = fabsf(p); if (hp < 0x01000000) { |