https://github.com/aboyadzhiev/php-math-parser
Simple mathematical expression parser and calculator.
https://github.com/aboyadzhiev/php-math-parser
calculator math mathematical-expression-parser php
Last synced: 6 months ago
JSON representation
Simple mathematical expression parser and calculator.
- Host: GitHub
- URL: https://github.com/aboyadzhiev/php-math-parser
- Owner: aboyadzhiev
- License: mit
- Created: 2014-10-26T19:30:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T14:55:41.000Z (over 3 years ago)
- Last Synced: 2025-09-27T11:36:34.435Z (9 months ago)
- Topics: calculator, math, mathematical-expression-parser, php
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 24
- Watchers: 4
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Math
Simple mathematical expression parser and calculator.
## Install
The recommended way to install Math is [through composer](http://getcomposer.org).
```JSON
{
"require": {
"aboyadzhiev/php-math-parser": "dev-master"
}
}
```
## Usage
Here is simple example of evaluating math expression
```php
evaluate($expression);
echo $result; // 302
$expression = '-2+-2*13*(7*8)-(415-0.1)';
$result = $parser->evaluate($expression);
echo $result; // -1872.90
```
## TODO
- Add additional translation strategy
## License
MIT, see LICENSE.