Add more floating-point classification macros.

This commit is contained in:
Stephen Heumann 2021-03-09 00:08:04 -06:00
parent 17a7fc5487
commit a3006e46b1
1 changed files with 5 additions and 0 deletions

View File

@ -39,6 +39,11 @@ int __fpclassifyl(long double);
double: __fpclassifyd, \
long double: __fpclassifyl)(x)
#define isfinite(x) (((fpclassify(x) + 1) & 0xF0) == 0)
#define isinf(x) (fpclassify(x) == FP_INFINITE)
#define isnan(x) (fpclassify((long double)(x)) == FP_NAN)
#define isnormal(x) (fpclassify(x) == FP_NORMAL)
#ifndef __KeepNamespacePure__
#define arctan(x) atan(x)
#endif