Back to index

glibc  2.9
s_isinfl.c
Go to the documentation of this file.
00001 /*
00002  * Written by J.T. Conklin <jtc@netbsd.org>.
00003  * Change for long double by Ulrich Drepper <drepper@cygnus.com>.
00004  * Public domain.
00005  */
00006 
00007 #if defined(LIBM_SCCS) && !defined(lint)
00008 static char rcsid[] = "$NetBSD: $";
00009 #endif
00010 
00011 /*
00012  * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0;
00013  * no branching!
00014  */
00015 
00016 #include "math.h"
00017 #include "math_private.h"
00018 
00019 int
00020 __isinfl (long double x)
00021 {
00022        int32_t se,hx,lx;
00023        GET_LDOUBLE_WORDS(se,hx,lx,x);
00024        lx |= (hx & 0x7fffffff) | ((se & 0x7fff) ^ 0x7fff);
00025        lx |= -lx;
00026        se &= 0x8000;
00027        return ~(lx >> 31) & (1 - (se >> 14));
00028 }
00029 hidden_def (__isinfl)
00030 weak_alias (__isinfl, isinfl)