diff options
Diffstat (limited to 'lib/msun/src/math.h')
-rw-r--r-- | lib/msun/src/math.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index 98601f825bbe..0abf4b605fb8 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -10,14 +10,11 @@ */ /* - * from: @(#)fdlibm.h 5.1 93/09/24 - * $FreeBSD$ */ #ifndef _MATH_H_ #define _MATH_H_ -#include <sys/cdefs.h> #include <sys/_types.h> #include <machine/_limits.h> @@ -79,18 +76,9 @@ extern const union __nan_un { #if __STDC_VERSION__ >= 201112L || __has_extension(c_generic_selections) #define __fp_type_select(x, f, d, ld) __extension__ _Generic((x), \ - float: f(x), \ - double: d(x), \ - long double: ld(x), \ - volatile float: f(x), \ - volatile double: d(x), \ - volatile long double: ld(x), \ - volatile const float: f(x), \ - volatile const double: d(x), \ - volatile const long double: ld(x), \ - const float: f(x), \ - const double: d(x), \ - const long double: ld(x)) + float: f, \ + double: d, \ + long double: ld)(x) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ @@ -154,6 +142,22 @@ typedef __float_t float_t; #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#if __BSD_VISIBLE || __XSI_VISIBLE >= 800 +#define M_El 2.718281828459045235360287471352662498L /* e */ +#define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */ +#define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */ +#define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */ +#define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */ +#define M_PIl 3.141592653589793238462643383279502884L /* pi */ +#define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */ +#define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */ +#define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */ +#define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */ +#define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */ +#define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */ +#define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */ +#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 800 */ + #define MAXFLOAT ((float)3.40282346638528860e+38) extern int signgam; #endif /* __BSD_VISIBLE || __XSI_VISIBLE */ @@ -193,21 +197,21 @@ int __signbitf(float) __pure2; int __signbitl(long double) __pure2; static __inline int -__inline_isnan(__const double __x) +__inline_isnan(const double __x) { return (__x != __x); } static __inline int -__inline_isnanf(__const float __x) +__inline_isnanf(const float __x) { return (__x != __x); } static __inline int -__inline_isnanl(__const long double __x) +__inline_isnanl(const long double __x) { return (__x != __x); |