Test GMP and BCMath



GMP extension library of PHP


These functions allow for arbitrary-length integers to be worked with using the GNU MP library.

This extension is available on Windows platforms since PHP 5.1.0

From PHP 5.6 onwards, the arithmetic, bitwise, and comparison operators may be used
with the GMP objects returned from gmp_init() and other GMP functions.
BCMath extension library of PHP


For arbitrary precision mathematics PHP offers BCMath which supports numbers of any size and precision
up to 2147483647 (or 0x7FFFFFFF) decimals, if there is sufficient memory, represented as strings.


Use GMP Use BCMath
1000! = factorial(1000) (-1.7976931348623157)^308
with scale 2000

Fatal error: Uncaught Error: Call to undefined function gmp_strval() in /host/home1/gauss/html/SimpleCalc/testGmpAndBcMath.php:94 Stack trace: #0 {main} thrown in /host/home1/gauss/html/SimpleCalc/testGmpAndBcMath.php on line 94