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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libm/] [math/] [sf_isinf.c] - Blame information for rev 39

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

Line No. Rev Author Line
1 39 lampret
/*
2
 * isinff(x) returns 1 if x is infinity, else 0;
3
 * no branching!
4
 * Added by Cygnus Support.
5
 */
6
 
7
#include "fdlibm.h"
8
 
9
#ifdef __STDC__
10
        int isinff(float x)
11
#else
12
        int isinff(x)
13
        float x;
14
#endif
15
{
16
        __int32_t ix;
17
        GET_FLOAT_WORD(ix,x);
18
        ix &= 0x7fffffff;
19
        ix = 0x7f800000 - ix;
20
        return 1 - (int)((__uint32_t)(ix|(-ix))>>31);
21
}
22
 
23
#ifdef _DOUBLE_IS_32BITS
24
 
25
#ifdef __STDC__
26
        int isinf(double x)
27
#else
28
        int isinf(x)
29
        double x;
30
#endif
31
{
32
        return isinff((float) x);
33
}
34
 
35
#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.