summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2007-01-06 21:22:38 +0000
committerdas <das@FreeBSD.org>2007-01-06 21:22:38 +0000
commitb4ef63382ce880e189f6a2fe2c88f2a02b122700 (patch)
tree5ca29b961a5cd0c413b0b506693d4f58ceb7eb47 /lib/msun
parentf0732593ba50e8fab60eaab2ed225841bc54c1aa (diff)
downloadFreeBSD-src-b4ef63382ce880e189f6a2fe2c88f2a02b122700.zip
FreeBSD-src-b4ef63382ce880e189f6a2fe2c88f2a02b122700.tar.gz
Correctly handle inf/nan. This routine is currently unused because we
seem to have assembly versions for all architectures, but it can't hurt to fix it.
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