libc/stdio/_scanf.c: heed lots of warnings about signed/unsigned chars
[uclibc-ng.git] / libm / s_isinff.c
blob6827024af03597163e15aa740abb5312f1e99e9d
1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 */
6 /*
7 * isinff(x) returns 1 if x is inf, -1 if x is -inf, else 0;
8 * no branching!
9 */
11 #include "math.h"
12 #include "math_private.h"
14 libm_hidden_proto(__isinff)
15 int
16 __isinff (float x)
18 int32_t ix,t;
19 GET_FLOAT_WORD(ix,x);
20 t = ix & 0x7fffffff;
21 t ^= 0x7f800000;
22 t |= -t;
23 return ~(t >> 31) & (ix >> 30);
25 libm_hidden_def(__isinff)
26 strong_alias (__isinff, isinff)