OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libm/] [common/] [sf_isnan.c] - Blame information for rev 179

Go to most recent revision | Details | Compare with Previous | View Log

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