diff --git a/include/math.h b/include/math.h index d732648..ffde3da 100644 --- a/include/math.h +++ b/include/math.h @@ -44,8 +44,13 @@ int __fpclassifyl(long double); union __float_repr { float __f; __uint32_t __i; }; union __double_repr { double __f; __uint64_t __i; }; +#if __STDC_VERSION__ >= 199901L #define __FLOAT_BITS(f) (((union __float_repr){ (float)(f) }).__i) #define __DOUBLE_BITS(f) (((union __double_repr){ (double)(f) }).__i) +#else +static __uint32_t __FLOAT_BITS(float __f) { union __float_repr __u = {__f}; return __u.__i; } +static __uint64_t __DOUBLE_BITS(double __f) { union __double_repr __u = {__f}; return __u.__i; } +#endif #define fpclassify(x) ( \ sizeof(x) == sizeof(float) ? __fpclassifyf(x) : \ @@ -199,8 +204,8 @@ float fmodf(float, float); long double fmodl(long double, long double); double frexp(double, int *); -float frexpf(float value, int *); -long double frexpl(long double value, int *); +float frexpf(float, int *); +long double frexpl(long double, int *); double hypot(double, double); float hypotf(float, float);