Last change
on this file since 559 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
638 bytes
|
Rev | Line | |
---|
[444] | 1 | /* |
---|
| 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 <math.h>. Newlib supplies it here as a function if the user |
---|
| 7 | * chooses to use it instead of the C99 macro. |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "fdlibm.h" |
---|
| 11 | #include <ieeefp.h> |
---|
| 12 | |
---|
| 13 | #undef isinff |
---|
| 14 | |
---|
| 15 | int |
---|
| 16 | isinff (float x) |
---|
| 17 | { |
---|
| 18 | __int32_t ix; |
---|
| 19 | GET_FLOAT_WORD(ix,x); |
---|
| 20 | ix &= 0x7fffffff; |
---|
| 21 | return FLT_UWORD_IS_INFINITE(ix); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | #ifdef _DOUBLE_IS_32BITS |
---|
| 25 | |
---|
| 26 | #undef isinf |
---|
| 27 | |
---|
| 28 | int |
---|
| 29 | isinf (double x) |
---|
| 30 | { |
---|
| 31 | return isinff((float) x); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | #endif /* defined(_DOUBLE_IS_32BITS) */ |
---|
Note: See
TracBrowser
for help on using the repository browser.