Blame sysdeps/ieee754/dbl-64/s_isinf.c
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
* Written by J.T. Conklin <jtc@netbsd.org>.
|
|
Packit Service |
82fcde |
* Changed to return -1 for -Inf by Ulrich Drepper <drepper@cygnus.com>.
|
|
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_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $";
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
* isinf(x) returns 1 is 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 |
#include <ldbl-classify-compat.h>
|
|
Packit Service |
82fcde |
#include <shlib-compat.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
int
|
|
Packit Service |
82fcde |
__isinf (double x)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
int32_t hx, lx;
|
|
Packit Service |
82fcde |
EXTRACT_WORDS (hx, lx, x);
|
|
Packit Service |
82fcde |
lx |= (hx & 0x7fffffff) ^ 0x7ff00000;
|
|
Packit Service |
82fcde |
lx |= -lx;
|
|
Packit Service |
82fcde |
return ~(lx >> 31) & (hx >> 30);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
hidden_def (__isinf)
|
|
Packit Service |
82fcde |
weak_alias (__isinf, isinf)
|
|
Packit Service |
82fcde |
#ifdef NO_LONG_DOUBLE
|
|
Packit Service |
82fcde |
# if LDBL_CLASSIFY_COMPAT && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23)
|
|
Packit Service |
82fcde |
compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0);
|
|
Packit Service |
82fcde |
# endif
|
|
Packit Service |
82fcde |
weak_alias (__isinf, isinfl)
|
|
Packit Service |
82fcde |
#endif
|