diff options
author | das <das@FreeBSD.org> | 2007-01-06 21:22:57 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2007-01-06 21:22:57 +0000 |
commit | 8441570fc8fbbf464859c55a5f32a0d618249024 (patch) | |
tree | bfca874f15315a955331be299d09c628536fda60 /lib/msun | |
parent | b4ef63382ce880e189f6a2fe2c88f2a02b122700 (diff) | |
download | FreeBSD-src-8441570fc8fbbf464859c55a5f32a0d618249024.zip FreeBSD-src-8441570fc8fbbf464859c55a5f32a0d618249024.tar.gz |
Correctly handle NaN.
Diffstat (limited to 'lib/msun')
-rw-r--r-- | lib/msun/src/s_modff.c | 2 |
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; |