Definition at line 69 of file Expr.php.
ExprParser::doExpression |
( |
| $expr | ) |
|
Evaluate a mathematical expression.
The algorithm here is based on the infix to RPN algorithm given in http://montcs.bloomu.edu/~bobmon/Information/RPN/infix2rpn.shtml It's essentially the same as Dijkstra's shunting yard algorithm.
- Parameters
-
- Exceptions
-
- Returns
- string
Definition at line 183 of file Expr.php.
References $matches, doOperation(), EXPR_ABS, EXPR_ARCCOS, EXPR_ARCSINE, EXPR_ARCTAN, EXPR_CEIL, EXPR_COSINE, EXPR_DIVIDE, EXPR_EQUALITY, EXPR_EXP, EXPR_EXPONENT, EXPR_FLOOR, EXPR_GREATER, EXPR_GREATEREQ, EXPR_LESS, EXPR_LESSEQ, EXPR_LN, EXPR_MINUS, EXPR_NEGATIVE, EXPR_NOT, EXPR_NOTEQ, EXPR_NUMBER_CLASS, EXPR_OPEN, EXPR_PI, EXPR_PLUS, EXPR_POSITIVE, EXPR_POW, EXPR_SINE, EXPR_SQRT, EXPR_TANGENS, EXPR_TIMES, EXPR_TRUNC, and EXPR_WHITE_CLASS.