summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/src/s_modf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/msun/src/s_modf.c b/lib/msun/src/s_modf.c
index 8cfe568..ab13191 100644
--- a/lib/msun/src/s_modf.c
+++ b/lib/msun/src/s_modf.c
@@ -55,6 +55,10 @@ modf(double x, double *iptr)
}
} else if (j0>51) { /* no fraction part */
u_int32_t high;
+ if (j0 == 0x400) { /* inf/NaN */
+ *iptr = x;
+ return 0.0 / x;
+ }
*iptr = x*one;
GET_HIGH_WORD(high,x);
INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
OpenPOWER on IntegriCloud