PHP code example of philipbrown / math
1. Go to this page and download the library: Download philipbrown/math 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/ */
philipbrown / math example snippets
use PhilipBrown\Math\Math;
/**
* Add
*
* @param mixed $left
* @param mixed $right
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::add(1.04, 2.406, 4);
/**
* Compare
*
* @param mixed $left
* @param mixed $right
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::compare(2.4567, 2.4566, 4);
/**
* Divide
*
* @param mixed $left
* @param mixed $right
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::divide(23.3945, 5, 4);
/**
* Modulus
*
* @param mixed $operand
* @param mixed $modulus
* @return PhilipBrown\Math\Number
*/
$number = Math::modulus(10, 3);
/**
* Multiply
*
* @param mixed $left
* @param mixed $right
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::multiply(5.34, 2.2, 3);
/**
* Power
*
* @param mixed $left
* @param mixed $right
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::power(43.22, 2, 5);
/**
* Square Root
*
* @param mixed $operand
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::squareRoot(454.213, 4);
/**
* Subtract
*
* @param mixed $left
* @param mixed $right
* @param mixed $scale
* @return PhilipBrown\Math\Number
*/
$number = Math::subtract(10.888, 2.123, 3);