martindilling / Calculator

Parse and calculate a mathematical expression in infix notation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calculator

Parse and calculate a mathematical expression in infix notation.

Example

Run the example with:

$infix = '1 + 1 * 3 + 3';

$calculator = new \Calculator\Calculator();
$result = $calculator->evaluate($infix);

echo $result; // 7

Tests

Unit tests is found in the tests folder. Run the tests with:

phpunit

About

Parse and calculate a mathematical expression in infix notation.


Languages

Language:PHP 100.0%