1 #include "fparser.hh" 2 #include "extrasrc/fpaux.hh" 3 4 #ifndef M_PI 5 #define M_PI 3.1415926535897932384626433832795 6 #endif 7 8 /* 9 #define CONSTANT_L10B 0.3010299956639811952137 // log10(2) 10 #define CONSTANT_L10BI 3.3219280948873623478703 // 1/log10(2) 11 #define CONSTANT_LB10 CONSTANT_L10BI // log2(10) 12 #define CONSTANT_LB10I CONSTANT_L10B // 1/log2(10) 13 */ 14 15 #define CONSTANT_POS_INF HUGE_VAL // positive infinity, from math.h 16 #define CONSTANT_NEG_INF (-HUGE_VAL) // negative infinity 17 18 namespace FUNCTIONPARSERTYPES 19 { 20 template<typename Value_t> fp_const_pihalf()21 inline Value_t fp_const_pihalf() // CONSTANT_PIHALF 22 { 23 return fp_const_pi<Value_t>() * Value_t(0.5); 24 } 25 template<typename Value_t> fp_const_twopi()26 inline Value_t fp_const_twopi() // CONSTANT_TWOPI 27 { 28 Value_t result( fp_const_pi<Value_t>() ); 29 result += result; 30 return result; 31 } 32 template<typename Value_t> fp_const_twoe()33 inline Value_t fp_const_twoe() // CONSTANT_2E 34 { 35 Value_t result( fp_const_e<Value_t>() ); 36 result += result; 37 return result; 38 } 39 template<typename Value_t> fp_const_twoeinv()40 inline Value_t fp_const_twoeinv() // CONSTANT_2EI 41 { 42 Value_t result( fp_const_einv<Value_t>() ); 43 result += result; 44 return result; 45 } 46 47 template<typename Value_t> fp_const_negativezero()48 inline Value_t fp_const_negativezero() 49 { 50 return -Epsilon<Value_t>::value; 51 } 52 } 53