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 */ 6 7 #if 0 /* vstr */ 8 #if defined(LIBM_SCCS) && !defined(lint) 9 static char rcsid[] = "$NetBSD: s_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $"; 10 #endif 11 12 /* 13 * isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0; 14 * no branching! 15 */ 16 17 #include "math.h" 18 #include "math_private.h" 19 20 #endif /* vstr */ 21 static 22 int __isinf(double x)23__isinf (double x) 24 { 25 int32_t hx,lx; 26 EXTRACT_WORDS(hx,lx,x); 27 lx |= (hx & 0x7fffffff) ^ 0x7ff00000; 28 lx |= -lx; 29 return ~(lx >> 31) & (hx >> 30); 30 } 31 #if 0 /* vstr */ 32 hidden_def (__isinf) 33 weak_alias (__isinf, isinf) 34 #ifdef NO_LONG_DOUBLE 35 strong_alias (__isinf, __isinfl) 36 weak_alias (__isinf, isinfl) 37 #endif 38 #endif /* vstr */ 39