diff options
author | Bruce Wells <brucekwells@gmail.com> | 2019-08-16 17:27:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-16 17:27:44 +0300 |
commit | ce5001573292f864471acf006b69186e2a2ba8be (patch) | |
tree | c8ea5a493e4fb91ee01b8e4221f2782e8027a88f /README.md | |
parent | 36b252b7c91fada20489be9ee60f173b49b823cb (diff) |
Subtraction fix (#46)v0.8.0
* Updated unit tests
* Fixed docs
* Better unary minus support
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -45,6 +45,8 @@ $executor->addFunction('abs', function($arg) {return abs($arg);}); ``` Function default parameters are not supported at this time. +Default parameters are not currently supported. + ## Operators: Default operators: `+ - * / ^` @@ -112,7 +114,7 @@ Default variables: ``` $pi = 3.14159265359 -$e = 2.71828182846 +$e = 2.71828182846 ``` You can add your own variables to executor: @@ -138,7 +140,7 @@ try { ``` ## Unary Minus Operator: -Negative numbers are supported via the unary minus operator, but need to have a space before the minus sign. `-1+ -3` is legal, while `-1+-3` will produce an error due to the way the parser works. Positive numbers are not explicitly supported as unsigned numbers are assumed positive. +Negative numbers are supported via the unary minus operator. Positive numbers are not explicitly supported as unsigned numbers are assumed positive. ## String Support: Expressions can contain double or single quoted strings that are evaluated the same way as PHP evalutes strings as numbers. You can also pass strings to functions. @@ -156,3 +158,7 @@ You can add operators, functions and variables with the public methods in MathEx This will allow you to remove functions and operators if needed, or implement different types more simply. Also note that you can replace an existing default operator by adding a new operator with the same regular expression string. For example if you just need to redefine TokenPlus, you can just add a new operator with the same regex string, in this case '\\+'. + +## Future Enhancements + +At some point this package will be upgraded to a currently supported version of PHP. |