source: trunk/libs/newlib/src/newlib/libm/common/sf_isnan.c @ 620

Last change on this file since 620 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 842 bytes
Line 
1/* sf_c_isnan.c -- float version of s_c_isnan.c.
2 */
3
4/*
5 * ====================================================
6 * Copyright (C) 1993 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/*
16 * isnanf(x) returns 1 is x is nan, else 0;
17 *
18 * isnanf is an extension declared in <math.h>.
19 */
20
21#include "fdlibm.h"
22#include <ieeefp.h>
23 
24#undef isnanf
25
26int
27isnanf (float x)
28{
29        __int32_t ix;
30        GET_FLOAT_WORD(ix,x);
31        ix &= 0x7fffffff;
32        return FLT_UWORD_IS_NAN(ix);
33}
34
35#ifdef _DOUBLE_IS_32BITS
36
37#undef isnan
38
39int
40isnan (double x)
41{
42        return isnanf((float) x);
43}
44
45#endif /* defined(_DOUBLE_IS_32BITS) */
Note: See TracBrowser for help on using the repository browser.