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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libm/] [common/] [sf_isinf.c] - Blame information for rev 617

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

Line No. Rev Author Line
1 207 jeremybenn
/*
2
 * isinff(x) returns 1 if x is +-infinity, else 0;
3
 *
4
 * isinf is a <math.h> macro in the C99 standard.  It was previously
5
 * implemented as isinf and isinff functions by newlib and are still declared
6
 * as such in <ieeefp.h>.  Newlib supplies it here as a function if the user
7
 * chooses to use <ieeefp.h> or needs to link older code compiled with the
8
 * previous <math.h> declaration.
9
 */
10
 
11
#include "fdlibm.h"
12
#include <ieeefp.h>
13
 
14
#undef isinff
15
 
16
int
17
_DEFUN (isinff, (x),
18
        float x)
19
{
20
        __int32_t ix;
21
        GET_FLOAT_WORD(ix,x);
22
        ix &= 0x7fffffff;
23
        return FLT_UWORD_IS_INFINITE(ix);
24
}
25
 
26
#ifdef _DOUBLE_IS_32BITS
27
 
28
#undef isinf
29
 
30
int
31
_DEFUN (isinf, (x),
32
        double x)
33
{
34
        return isinff((float) x);
35
}
36
 
37
#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.