Blame sysdeps/ieee754/flt-32/s_isinff.c

Packit Service 82fcde
/*
Packit Service 82fcde
 * Written by J.T. Conklin <jtc@netbsd.org>.
Packit Service 82fcde
 * Public domain.
Packit Service 82fcde
 */
Packit Service 82fcde
Packit Service 82fcde
#if defined(LIBM_SCCS) && !defined(lint)
Packit Service 82fcde
static char rcsid[] = "$NetBSD: s_isinff.c,v 1.3 1995/05/11 23:20:21 jtc Exp $";
Packit Service 82fcde
#endif
Packit Service 82fcde
Packit Service 82fcde
/*
Packit Service 82fcde
 * isinff(x) returns 1 if x is inf, -1 if x is -inf, else 0;
Packit Service 82fcde
 * no branching!
Packit Service 82fcde
 */
Packit Service 82fcde
Packit Service 82fcde
#include <math.h>
Packit Service 82fcde
#include <math_private.h>
Packit Service 82fcde
Packit Service 82fcde
int
Packit Service 82fcde
__isinff (float x)
Packit Service 82fcde
{
Packit Service 82fcde
	int32_t ix,t;
Packit Service 82fcde
	GET_FLOAT_WORD(ix,x);
Packit Service 82fcde
	t = ix & 0x7fffffff;
Packit Service 82fcde
	t ^= 0x7f800000;
Packit Service 82fcde
	t |= -t;
Packit Service 82fcde
	return ~(t >> 31) & (ix >> 30);
Packit Service 82fcde
}
Packit Service 82fcde
hidden_def (__isinff)
Packit Service 82fcde
weak_alias (__isinff, isinff)