2000-02-17 19:39:52 +00:00
|
|
|
/*
|
2001-04-04 13:33:01 +00:00
|
|
|
* isinff(x) returns 1 if x is +-infinity, else 0;
|
2006-02-27 23:51:28 +00:00
|
|
|
*
|
2009-07-09 17:04:56 +00:00
|
|
|
* isinf is a <math.h> macro in the C99 standard. It was previously
|
|
|
|
* implemented as isinf and isinff functions by newlib and are still declared
|
2016-04-04 15:49:31 -05:00
|
|
|
* as such in <math.h>. Newlib supplies it here as a function if the user
|
|
|
|
* chooses to use it instead of the C99 macro.
|
2000-02-17 19:39:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "fdlibm.h"
|
2009-07-09 17:04:56 +00:00
|
|
|
#include <ieeefp.h>
|
|
|
|
|
|
|
|
#undef isinff
|
2000-02-17 19:39:52 +00:00
|
|
|
|
2006-02-27 23:51:28 +00:00
|
|
|
int
|
2017-12-03 21:43:30 -06:00
|
|
|
isinff (float x)
|
2000-02-17 19:39:52 +00:00
|
|
|
{
|
|
|
|
__int32_t ix;
|
|
|
|
GET_FLOAT_WORD(ix,x);
|
|
|
|
ix &= 0x7fffffff;
|
2001-04-04 13:33:01 +00:00
|
|
|
return FLT_UWORD_IS_INFINITE(ix);
|
2000-02-17 19:39:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _DOUBLE_IS_32BITS
|
|
|
|
|
2006-03-07 22:14:04 +00:00
|
|
|
#undef isinf
|
|
|
|
|
2006-02-27 23:51:28 +00:00
|
|
|
int
|
2017-12-03 21:43:30 -06:00
|
|
|
isinf (double x)
|
2000-02-17 19:39:52 +00:00
|
|
|
{
|
|
|
|
return isinff((float) x);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* defined(_DOUBLE_IS_32BITS) */
|