glibc/sysdeps/ieee754/dbl-64/s_isinf.c
Ulrich Drepper f83af095b6 Update.
* include/math.h: Declare __isinf_internal, __isinfl_internal,
	__isnan_internal, and __isnanl_internal.
	* stdio-common/printf_fp.c: Use INTUSE for calls to __isinf, __isinfl,
	__isnan, and __isnanl.
	* stdio-common/printf_size.c: Likewise.
	* sysdeps/generic/printf_fphex.c: Likewise.
	* sysdeps/i386/fpu/s_isinfl.c: Also define _internal alias.
	* sysdeps/i386/fpu/s_isnanl.c: Likewise.
	* sysdeps/ia64/fpu/s_isinf.S: Likewise.
	* sysdeps/ia64/fpu/s_isnan.S: Likewise.
	* sysdeps/ieee754/dbl-64/s_isinf.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_isnan.c: Likewise.
	* sysdeps/ieee754/flt-32/s_isinff.c: Likewise.
	* sysdeps/ieee754/flt-32/s_isnanf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_isinfl.c: Likewise.
	* sysdeps/m68k/s_isinfl.c: Likewise.
	* sysdeps/m68k/fpu/s_isinf.c: Likewise.
	* sysdeps/powerpc/fpu/s_isnan.c: Likewise.
2002-04-14 17:55:43 +00:00

35 lines
708 B
C

/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Changed to return -1 for -Inf by Ulrich Drepper <drepper@cygnus.com>.
* Public domain.
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: s_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $";
#endif
/*
* isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0;
* no branching!
*/
#include "math.h"
#include "math_private.h"
int
__isinf (double x)
{
int32_t hx,lx;
EXTRACT_WORDS(hx,lx,x);
lx |= (hx & 0x7fffffff) ^ 0x7ff00000;
lx |= -lx;
return ~(lx >> 31) & (hx >> 30);
}
INTDEF(__isinf)
weak_alias (__isinf, isinf)
#ifdef NO_LONG_DOUBLE
strong_alias (__isinf, __isinfl)
INTDEF(__isinfl)
weak_alias (__isinf, isinfl)
#endif