diff options
Diffstat (limited to 'math')
-rw-r--r-- | math/Makefile | 2 | ||||
-rw-r--r-- | math/math.h | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/math/Makefile b/math/Makefile index a7c2b07fd8..ac3a90a582 100644 --- a/math/Makefile +++ b/math/Makefile @@ -28,7 +28,7 @@ headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \ bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \ bits/math-finite.h bits/math-vector.h \ bits/libm-simd-decl-stubs.h bits/iscanonical.h \ - bits/flt-eval-method.h bits/fp-fast.h + bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h # FPU support code. aux := setfpucw fpu_control diff --git a/math/math.h b/math/math.h index 95b39b3d92..6e4bf9e528 100644 --- a/math/math.h +++ b/math/math.h @@ -97,13 +97,30 @@ typedef _Float128x double_t; # endif #endif -/* Define macros for the return value of ilogb. +/* Define macros for the return value of ilogb, based on + __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'. FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'. */ +#include <bits/fp-logb.h> +#ifdef __USE_ISOC99 +# if __FP_LOGB0_IS_MIN +# define FP_ILOGB0 (-2147483647 - 1) +# else +# define FP_ILOGB0 (-2147483647) +# endif +# if __FP_LOGBNAN_IS_MIN +# define FP_ILOGBNAN (-2147483647 - 1) +# else +# define FP_ILOGBNAN 2147483647 +# endif +#endif + +/* Get information about long double. */ + #include <bits/mathdef.h> /* Get the architecture specific values describing the floating-point |