summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2007-01-06 21:22:57 +0000
committerdas <das@FreeBSD.org>2007-01-06 21:22:57 +0000
commit8441570fc8fbbf464859c55a5f32a0d618249024 (patch)
treebfca874f15315a955331be299d09c628536fda60 /lib
parentb4ef63382ce880e189f6a2fe2c88f2a02b122700 (diff)
downloadFreeBSD-src-8441570fc8fbbf464859c55a5f32a0d618249024.zip
FreeBSD-src-8441570fc8fbbf464859c55a5f32a0d618249024.tar.gz
Correctly handle NaN.
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/src/s_modff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/msun/src/s_modff.c b/lib/msun/src/s_modff.c
index 69b64e9..4436764 100644
--- a/lib/msun/src/s_modff.c
+++ b/lib/msun/src/s_modff.c
@@ -49,6 +49,8 @@ modff(float x, float *iptr)
} else { /* no fraction part */
u_int32_t ix;
*iptr = x*one;
+ if (x != x) /* NaN */
+ return x;
GET_FLOAT_WORD(ix,x);
SET_FLOAT_WORD(x,ix&0x80000000); /* return +-0 */
return x;
OpenPOWER on IntegriCloud