PHP code example of robertbakker / big-calculator

1. Go to this page and download the library: Download robertbakker/big-calculator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

robertbakker / big-calculator example snippets


use RobertBakker\BigCalculator\Calculator;

$calculator = Calculator::create();
$calculator->calculate("1.234 / 5 + 3.4"); // outputs \Brick\Math\BigDecimal


// Example with 4% interest over 3 years
$calculator = Calculator::create();
$calculator->addVariable("years", 3);
$calculator->calculate("2000 * 1.04 ^ years");