diff options
Diffstat (limited to 'newlib/libc/include/math.h')
-rw-r--r-- | newlib/libc/include/math.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 3e96757c8..63cc99286 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -131,21 +131,29 @@ extern int __signbitd (double x); (__extension__ ({__typeof__(x) __x = (x); \ (sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : __fpclassifyd(__x);})) +#ifndef isfinite #define isfinite(y) \ (__extension__ ({__typeof__(y) __y = (y); \ fpclassify(__y) != FP_INFINITE && fpclassify(__y) != FP_NAN;})) +#endif /* Note: isinf and isnan were once functions in newlib that took double * arguments. C99 specifies that these names are reserved for macros * supporting multiple floating point types. Thus, they are * now defined as macros. Implementations of the old functions * taking double arguments still exist for compatibility purposes. */ +#ifndef isinf #define isinf(x) \ (__extension__ ({__typeof__(x) __x = (x); \ (sizeof (__x) == sizeof (float)) ? __isinff(__x) : __isinfd(__x);})) +#endif + +#ifndef isnan #define isnan(x) \ (__extension__ ({__typeof__(x) __x = (x); \ (sizeof (__x) == sizeof (float)) ? __isnanf(__x) : __isnand(__x);})) +#endif + #define isnormal(y) (fpclassify(y) == FP_NORMAL) #define signbit(x) \ (__extension__ ({__typeof__(x) __x = (x); \ |