test: add nftw test case
[uclibc-ng.git] / libm / s_isinf.c
blob62e5263bb6612b1185d7ca473779a571550b26e9
1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Changed to return -1 for -Inf by Ulrich Drepper <drepper@cygnus.com>.
4 * Public domain.
5 */
7 /*
8 * isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0;
9 * no branching!
12 #include "math.h"
13 #include "math_private.h"
15 int __isinf(double x)
17 int32_t hx,lx;
18 EXTRACT_WORDS(hx,lx,x);
19 lx |= (hx & 0x7fffffff) ^ 0x7ff00000;
20 lx |= -lx;
21 return ~(lx >> 31) & (hx >> 30);
23 libm_hidden_def(__isinf)