|
Packit |
6c4009 |
/* s_finitel.c -- long double version of s_finite.c.
|
|
Packit |
6c4009 |
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* ====================================================
|
|
Packit |
6c4009 |
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
Packit |
6c4009 |
* Permission to use, copy, modify, and distribute this
|
|
Packit |
6c4009 |
* software is freely granted, provided that this notice
|
|
Packit |
6c4009 |
* is preserved.
|
|
Packit |
6c4009 |
* ====================================================
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if defined(LIBM_SCCS) && !defined(lint)
|
|
Packit |
6c4009 |
static char rcsid[] = "$NetBSD: $";
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* finitel(x) returns 1 is x is finite, else 0;
|
|
Packit |
6c4009 |
* no branching!
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <math.h>
|
|
Packit |
6c4009 |
#include <math_private.h>
|
|
Packit |
6c4009 |
#include <math_ldbl_opt.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
int
|
|
Packit |
6c4009 |
___finitel (long double x)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
uint64_t hx;
|
|
Packit |
6c4009 |
double xhi;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
xhi = ldbl_high (x);
|
|
Packit |
6c4009 |
EXTRACT_WORDS64 (hx, xhi);
|
|
Packit |
6c4009 |
hx &= 0x7ff0000000000000LL;
|
|
Packit |
6c4009 |
hx -= 0x7ff0000000000000LL;
|
|
Packit |
6c4009 |
return hx >> 63;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
hidden_ver (___finitel, __finitel)
|
|
Packit |
6c4009 |
weak_alias (___finitel, ____finitel)
|
|
Packit |
6c4009 |
#if IS_IN (libm)
|
|
Packit |
6c4009 |
long_double_symbol (libm, ____finitel, finitel);
|
|
Packit |
6c4009 |
long_double_symbol (libm, ___finitel, __finitel);
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
long_double_symbol (libc, ____finitel, finitel);
|
|
Packit |
6c4009 |
long_double_symbol (libc, ___finitel, __finitel);
|
|
Packit |
6c4009 |
#endif
|