diff options
Diffstat (limited to 'include/math.h')
-rw-r--r-- | include/math.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/include/math.h b/include/math.h index 01428152..c029156a 100644 --- a/include/math.h +++ b/include/math.h @@ -9,9 +9,6 @@ extern "C" { #define __NEED_float_t #define __NEED_double_t -#define __NEED___uint16_t -#define __NEED___uint32_t -#define __NEED___uint64_t #include <bits/alltypes.h> #if 100*__GNUC__+__GNUC_MINOR__ >= 303 @@ -43,14 +40,14 @@ int __fpclassify(double); int __fpclassifyf(float); int __fpclassifyl(long double); -static __inline __uint32_t __FLOAT_BITS(float __f) +static __inline unsigned __FLOAT_BITS(float __f) { - union {float __f; __uint32_t __i;} __u = {__f}; + union {float __f; unsigned __i;} __u = {__f}; return __u.__i; } -static __inline __uint64_t __DOUBLE_BITS(double __f) +static __inline unsigned long long __DOUBLE_BITS(double __f) { - union {double __f; __uint64_t __i;} __u = {__f}; + union {double __f; unsigned long long __i;} __u = {__f}; return __u.__i; } @@ -61,22 +58,22 @@ static __inline __uint64_t __DOUBLE_BITS(double __f) #define isinf(x) ( \ sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) == 0x7f800000 : \ - sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & (__uint64_t)-1>>1) == (__uint64_t)0x7ff<<52 : \ + sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) == 0x7ffULL<<52 : \ __fpclassifyl(x) == FP_INFINITE) #define isnan(x) ( \ sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000 : \ - sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & (__uint64_t)-1>>1) > (__uint64_t)0x7ff<<52 : \ + sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) > 0x7ffULL<<52 : \ __fpclassifyl(x) == FP_NAN) #define isnormal(x) ( \ sizeof(x) == sizeof(float) ? ((__FLOAT_BITS(x)+0x00800000) & 0x7fffffff) >= 0x01000000 : \ - sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+((__uint64_t)1<<52)) & (__uint64_t)-1>>1) >= (__uint64_t)1<<53 : \ + sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+(1ULL<<52)) & -1ULL>>1) >= 1ULL<<53 : \ __fpclassifyl(x) == FP_NORMAL) #define isfinite(x) ( \ sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) < 0x7f800000 : \ - sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & (__uint64_t)-1>>1) < (__uint64_t)0x7ff<<52 : \ + sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) < 0x7ffULL<<52 : \ __fpclassifyl(x) > FP_INFINITE) int __signbit(double); |