PackToDouble(sin(c));
62 returnPackToDouble(cos(c));
69 returnPackToDouble(tan(c));
76 returnPackToDouble(sqrt(c));
83c2 = UnpackToComplex(
v2);
84 returnPackToDouble(c1+c2);
91c2 = UnpackToComplex(
v2);
92 returnPackToDouble(c1-c2);
99c2 = UnpackToComplex(
v2);
100 returnPackToDouble(c1*c2);
107c2 = UnpackToComplex(
v2);
108 returnPackToDouble(c1/c2);
141ParserComplex::ParserComplex()
154 DefineNameChars(
wxT(
"0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") );
193 floatimag(0), real(0);
195real = *((
float*)(&
val));
196imag = *((
float*)(&
val)+1);
205 float*real = (
float*)(&packed),
206*imag = (
float*)(&packed)+1;
Mathematical expressions parser (base parser engine).
void AddValIdent(identfun_type a_pCallback)
void DefineInfixOprt(const string_type &a_strName, fun_type1 a_pOprt, int a_iPrec=prINFIX, bool a_bAllowOpt=true)
Add a user defined operator.
value_type Eval() const
Calculate the result.
void DefineOprt(const string_type &a_strName, fun_type2 a_pFun, unsigned a_iPri=0, bool a_bAllowOpt=false)
Define a binary operator.
void DefineOprtChars(const char_type *a_szCharset)
Define the set of valid characters to be used in names of binary operators and postfix operators.
void DefineInfixOprtChars(const char_type *a_szCharset)
Define the set of valid characters to be used in names of infix operators.
void DefineNameChars(const char_type *a_szCharset)
Define the set of valid characters to be used in names of functions, variables, constants.
void EnableBuiltInOprt(bool a_bIsOn=true)
Enable or disable the built in binary operators.
void DefineFun(const string_type &a_strName, fun_type0 a_pFun, bool a_bAllowOpt=true)
static value_type Sub(value_type v1, value_type v2)
static value_type Add(value_type v1, value_type v2)
static double PackToDouble(const complex_type &val)
virtual void InitOprt()
Initialize operators.
static value_type Sin(value_type)
std::complex< float > complex_type
static value_type Cos(value_type)
static int IsVal(const char_type *a_szExpr, int *a_iPos, value_type *a_iVal)
static value_type Mul(value_type v1, value_type v2)
static value_type Tan(value_type)
static value_type Sqrt(value_type)
static value_type Div(value_type v1, value_type v2)
static complex_type UnpackToComplex(double val)
static value_type UnaryMinus(value_type)
virtual void InitCharSets()
This file contains a definition of a parser using complex numbers.
Namespace for mathematical applications.
string_type::value_type char_type
The character type used by the parser.
@ prMUL_DIV
multiplication/division
double value_type
The numeric datatype used by the parser.
std::string string_type
The stringtype used by the parser.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4