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 Jakub Jelinek <jj@ultra.linux.cz>
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 #include <math_ldbl_opt.h>
00019 
00020 int
00021 ___isinfl (long double x)
00022 {
00023        int64_t hx,lx;
00024        GET_LDOUBLE_WORDS64(hx,lx,x);
00025        lx = (lx & 0x7fffffffffffffffLL);
00026        lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7ff0000000000000LL;
00027        lx |= -lx;
00028        return ~(lx >> 63) & (hx >> 62);
00029 }
00030 hidden_ver (___isinfl, __isinfl)
00031 #ifndef IS_IN_libm
00032 weak_alias (___isinfl, ____isinfl)
00033 long_double_symbol (libc, ___isinfl, isinfl);
00034 long_double_symbol (libc, ____isinfl, __isinfl);
00035 #endif