1 /* s_isnanf.c -- float version of s_isnan.c.
2 */
3
4 /*
5 * ====================================================
6 * Copyright (C) 1993, 2011 by Sun Microsystems, Inc. All rights reserved.
7 *
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
11 * is preserved.
12 * ====================================================
13 */
14
15 #if defined(LIBM_SCCS) && !defined(lint)
16 static char rcsid[] = "$NetBSD: s_isnanf.c,v 1.4 1995/05/10 20:47:38 jtc Exp $";
17 #endif
18
19 /*
20 * isnanf(x) returns 1 is x is nan, else 0;
21 * no branching!
22 */
23
24 #include <math.h>
25 #include <math_private.h>
26
27 #undef __isnanf
__isnanf(float x)28 int __isnanf(float x)
29 {
30 int32_t ix;
31 GET_FLOAT_WORD(ix,x);
32 ix &= 0x7fffffff;
33 ix = 0x7f800000 - ix;
34 return (int)(((uint32_t)(ix))>>31);
35 }
36 hidden_def (__isnanf)
37 weak_alias (__isnanf, isnanf)
38