1 /* s_isnanl.c -- long double version for i387 of s_isnan.c.
5 * ====================================================
6 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 * Developed at SunPro, a Sun Microsystems, Inc. business.
9 * Permission to use, copy, modify, and distribute this
10 * software is freely granted, provided that this notice
12 * ====================================================
15 #if defined(LIBM_SCCS) && !defined(lint)
16 static char rcsid
[] = "$NetBSD: $";
20 * isnanl(x) returns 1 is x is nan, else 0;
25 #include <math_private.h>
27 int __isnanl(long double x
)
30 GET_LDOUBLE_WORDS(se
,hx
,lx
,x
);
31 se
= (se
& 0x7fff) << 1;
32 /* Detect pseudo-normal numbers, i.e. exponent is non-zero and the top
33 bit of the significand is not set. */
34 pn
= (uint32_t)((~hx
& 0x80000000) & (se
|(-se
)))>>31;
35 /* Clear the significand bit when computing mantissa. */
36 lx
|= hx
& 0x7fffffff;
37 se
|= (uint32_t)(lx
|(-lx
))>>31;
40 return (int)(((uint32_t)(se
)) >> 16) | pn
;
43 weak_alias (__isnanl
, isnanl
)