From 829d55ac9c8ec945f1f131937efb319a30535ae0 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Sat, 6 Jan 2007 21:22:57 +0000 Subject: Correctly handle NaN. --- lib/msun/src/s_modff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/msun/src/s_modff.c b/lib/msun/src/s_modff.c index 69b64e901cf9..4436764ecb24 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; -- cgit v1.3