OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [common/] [sf_isnan.c] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* 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 <ieeefp.h>.
19
 */
20
 
21
#include "fdlibm.h"
22
#include <ieeefp.h>
23
 
24
#undef isnanf
25
 
26
int
27
_DEFUN (isnanf, (x),
28
        float x)
29
{
30
        __int32_t ix;
31
        GET_FLOAT_WORD(ix,x);
32
        ix &= 0x7fffffff;
33
        return FLT_UWORD_IS_NAN(ix);
34
}
35
 
36
#ifdef _DOUBLE_IS_32BITS
37
 
38
#undef isnan
39
 
40
int
41
_DEFUN (isnan, (x),
42
        double x)
43
{
44
        return isnanf((float) x);
45
}
46
 
47
#endif /* defined(_DOUBLE_IS_32BITS) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.