Retro68/gcc/libquadmath/math/finiteq.c

34 lines
852 B
C
Raw Normal View History

2019-06-02 15:48:37 +00:00
/* s_finitel.c -- long double version of s_finite.c.
2012-03-27 23:13:14 +00:00
* Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
2019-06-02 15:48:37 +00:00
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: $";
#endif
2012-03-27 23:13:14 +00:00
2014-09-21 17:33:12 +00:00
/*
* finiteq(x) returns 1 is x is finite, else 0;
* no branching!
*/
2019-06-02 15:48:37 +00:00
#include "quadmath-imp.h"
int finiteq(__float128 x)
2012-03-27 23:13:14 +00:00
{
2019-06-02 15:48:37 +00:00
int64_t hx;
GET_FLT128_MSW64(hx,x);
return (int)((uint64_t)((hx&0x7fff000000000000LL)
-0x7fff000000000000LL)>>63);
2012-03-27 23:13:14 +00:00
}