summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_ilogbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun/src/s_ilogbf.c')
-rw-r--r--lib/msun/src/s_ilogbf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/msun/src/s_ilogbf.c b/lib/msun/src/s_ilogbf.c
index b65a365..ff58813 100644
--- a/lib/msun/src/s_ilogbf.c
+++ b/lib/msun/src/s_ilogbf.c
@@ -17,6 +17,8 @@
static char rcsid[] = "$FreeBSD$";
#endif
+#include <limits.h>
+
#include "math.h"
#include "math_private.h"
@@ -28,11 +30,12 @@ static char rcsid[] = "$FreeBSD$";
hx &= 0x7fffffff;
if(hx<0x00800000) {
if(hx==0)
- return 0x80000001; /* ilogb(0) = 0x80000001 */
+ return FP_ILOGB0;
else /* subnormal x */
for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1;
return ix;
}
else if (hx<0x7f800000) return (hx>>23)-127;
- else return 0x7fffffff;
+ else if (hx>0x7f800000) return FP_ILOGBNAN;
+ else return INT_MAX;
}
OpenPOWER on IntegriCloud