Retro68/gcc/libquadmath/math/isinfq.c

27 lines
513 B
C
Raw Normal View History

2012-03-27 23:13:14 +00:00
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Change for long double by Jakub Jelinek <jj@ultra.linux.cz>
* Public domain.
*/
2019-06-02 15:48:37 +00:00
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: $";
#endif
/*
* isinfq(x) returns 1 if x is inf, -1 if x is -inf, else 0;
* no branching!
*/
2012-03-27 23:13:14 +00:00
#include "quadmath-imp.h"
int
isinfq (__float128 x)
{
2019-06-02 15:48:37 +00:00
int64_t hx,lx;
GET_FLT128_WORDS64(hx,lx,x);
lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL;
lx |= -lx;
return ~(lx >> 63) & (hx >> 62);
2012-03-27 23:13:14 +00:00
}