PHP code example of danhunsaker / bcmath

1. Go to this page and download the library: Download danhunsaker/bcmath 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/ */

    

danhunsaker / bcmath example snippets


BC::parse('{m} * {x} + {b}', ['m' => 0.5, 'x' => 5, 'b' => 0]);

BC::parse('{m} * {x} + {b}', ['m' => 0.5, 'x' => 5, 'b' => 0], 18);

BC::parse('{m} * {x} + {b}', null, 18);

// Any unrecognized variables are assumed to be zero,
// so the above is the same as:

BC::parse('0 * 0 + 0', null, 18);