diff --git a/src/decimal.hpp b/src/decimal.hpp index 16689ea1..f49b1d35 100644 --- a/src/decimal.hpp +++ b/src/decimal.hpp @@ -1,6 +1,9 @@ #ifndef DECIMAL_H #define DECIMAL_H +#include +#include + #ifdef LOST_FLOAT_MODE typedef float decimal; #define STR_TO_DECIMAL(x) std::stof(x) @@ -18,19 +21,19 @@ #define DECIMAL(x) (decimal) x // Math Constants wrapped with Decimal typecast -#define DECIMAL_M_E (decimal) 2.7182818284590452354 /* e */ -#define DECIMAL_M_LOG2E (decimal) 1.4426950408889634074 /* log_2 e */ -#define DECIMAL_M_LOG10E (decimal) 0.43429448190325182765 /* log_10 e */ -#define DECIMAL_M_LN2 (decimal) 0.69314718055994530942 /* log_e 2 */ -#define DECIMAL_M_LN10 (decimal) 2.30258509299404568402 /* log_e 10 */ -#define DECIMAL_M_PI (decimal) 3.14159265358979323846 /* pi */ -#define DECIMAL_M_PI_2 (decimal) 1.57079632679489661923 /* pi/2 */ -#define DECIMAL_M_PI_4 (decimal) 0.78539816339744830962 /* pi/4 */ -#define DECIMAL_M_1_PI (decimal) 0.31830988618379067154 /* 1/pi */ -#define DECIMAL_M_2_PI (decimal) 0.63661977236758134308 /* 2/pi */ -#define DECIMAL_M_2_SQRTPI (decimal) 1.12837916709551257390 /* 2/sqrt(pi) */ -#define DECIMAL_M_SQRT2 (decimal) 1.41421356237309504880 /* sqrt(2) */ -#define DECIMAL_M_SQRT1_2 (decimal) 0.70710678118654752440 /* 1/sqrt(2) */ +#define DECIMAL_M_E (decimal) M_E /* e */ +#define DECIMAL_M_LOG2E (decimal) M_LOG2E /* log_2 e */ +#define DECIMAL_M_LOG10E (decimal) M_LOG10E /* log_10 e */ +#define DECIMAL_M_LN2 (decimal) M_LN2 /* log_e 2 */ +#define DECIMAL_M_LN10 (decimal) M_LN10 /* log_e 10 */ +#define DECIMAL_M_PI (decimal) M_PI /* pi */ +#define DECIMAL_M_PI_2 (decimal) M_PI_2 /* pi/2 */ +#define DECIMAL_M_PI_4 (decimal) M_PI_4 /* pi/4 */ +#define DECIMAL_M_1_PI (decimal) M_1_PI /* 1/pi */ +#define DECIMAL_M_2_PI (decimal) M_2_PI /* 2/pi */ +#define DECIMAL_M_2_SQRTPI (decimal) M_2_SQRTPI /* 2/sqrt(pi) */ +#define DECIMAL_M_SQRT2 (decimal) M_SQRT2 /* sqrt(2) */ +#define DECIMAL_M_SQRT1_2 (decimal) M_SQRT1_2 /* 1/sqrt(2) */ // Math Functions wrapped with Decimal typecast #define DECIMAL_POW(base,power) (decimal) std::pow(base, power)