Math¶
There are many math features in PHP. There are the native math functions, such as exp(), cos() or abs(); there are operators, such as +, *, **, etc. There are special notions, such as NaN, Not a number, and the constant INF, which represents the infinite.
There are also extension, such as bcmath and gmp, to handle arbitrary large numbers.
Finally, there are many packages that provide optimized code to run math specialties, like matrices, complex numbers or statistical tools.
<?php
$total = 1 + 2 * 3 - 4 ** 5;
?>
Related : Bcmath, GNU Multiple Precision (GMP), Floating Point Numbers, integer, Not A Number (NAN), INF, Rounding
Related packages : brick/math, markbaker/complex, markbaker/matrix, markrogoyski/math-php