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

source code of glibc/sysdeps/ieee754/ldbl-128/s_isinfl.c