Math
class Math (View source)
Core class of the library performing parsing and calculations.
Properties
protected | $variables | ||
protected | $stack |
Methods
int
evaluate(string $string)
Parses and executes given formula
void
parse(string $string)
Parses given formula. The parsed formula is stored in the class.
void
registerVariable(string $name, int $value)
Registers variable for use withing calculation
int
run()
Executes currently parsed formula with current variables
tokenize($string)
No description
Details
int
evaluate(string $string)
Parses and executes given formula
void
parse(string $string)
Parses given formula. The parsed formula is stored in the class.
void
registerVariable(string $name, int $value)
Registers variable for use withing calculation
int
run()
Executes currently parsed formula with current variables
protected
parseParenthesis(Expression $expression, Stack $output, Stack $operators)
No description
protected
parseOperator(Expression $expression, Stack $output, Stack $operators)
No description
protected
tokenize($string)
No description