]>
Commit | Line | Data |
---|---|---|
76060ec0 | 1 | /* |
76060ec0 RM |
2 | * Public domain. |
3 | */ | |
4 | ||
5 | #if defined(LIBM_SCCS) && !defined(lint) | |
6 | static char rcsid[] = "$NetBSD: $"; | |
7 | #endif | |
8 | ||
9 | /* | |
0d8733c4 | 10 | * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0; |
76060ec0 RM |
11 | * no branching! |
12 | */ | |
13 | ||
1ed0291c RH |
14 | #include <math.h> |
15 | #include <math_private.h> | |
76060ec0 | 16 | |
0413b54c | 17 | int |
15089e04 | 18 | __isinfl (_Float128 x) |
76060ec0 | 19 | { |
abfbdde1 UD |
20 | int64_t hx,lx; |
21 | GET_LDOUBLE_WORDS64(hx,lx,x); | |
22 | lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; | |
9eb2730e | 23 | lx |= -lx; |
abfbdde1 | 24 | return ~(lx >> 63) & (hx >> 62); |
76060ec0 | 25 | } |
593bf718 | 26 | mathx_hidden_def (__isinfl) |
76060ec0 | 27 | weak_alias (__isinfl, isinfl) |