X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fmath.h;h=14f28ec8c646596aee2d78c662a65584def559a1;hb=718f363bc2067b6487900eddc9180c84e7739f80;hp=ec04a8a7d1a70c6ac39dbea8c317753055915012;hpb=5d01ab4ac64b913c537e91f7c01d5c8e910151da;p=musl diff --git a/include/math.h b/include/math.h index ec04a8a7..14f28ec8 100644 --- a/include/math.h +++ b/include/math.h @@ -16,7 +16,7 @@ extern "C" { #define INFINITY __builtin_inff() #else #define NAN (0.0f/0.0f) -#define INFINITY 1e40f +#define INFINITY 1e5000f #endif #define HUGE_VALF INFINITY @@ -27,7 +27,7 @@ extern "C" { #define MATH_ERREXCEPT 2 #define math_errhandling 2 -#define FP_ILOGBNAN (-1-(int)(((unsigned)-1)>>1)) +#define FP_ILOGBNAN (-1-0x7fffffff) #define FP_ILOGB0 FP_ILOGBNAN #define FP_NAN 0 @@ -36,18 +36,32 @@ extern "C" { #define FP_SUBNORMAL 3 #define FP_NORMAL 4 +#ifdef __FP_FAST_FMA +#define FP_FAST_FMA 1 +#endif + +#ifdef __FP_FAST_FMAF +#define FP_FAST_FMAF 1 +#endif + +#ifdef __FP_FAST_FMAL +#define FP_FAST_FMAL 1 +#endif + int __fpclassify(double); int __fpclassifyf(float); int __fpclassifyl(long double); static __inline unsigned __FLOAT_BITS(float __f) { - union {float __f; unsigned __i;} __u = {__f}; + union {float __f; unsigned __i;} __u; + __u.__f = __f; return __u.__i; } static __inline unsigned long long __DOUBLE_BITS(double __f) { - union {double __f; unsigned long long __i;} __u = {__f}; + union {double __f; unsigned long long __i;} __u; + __u.__f = __f; return __u.__i; }