A PHP library to work with big integers. This library makes use of the GMP extension to do its calculations.
Via Composer
$ composer require phpmath/biginteger
use PHP\Math\BigInteger\BigInteger;
$number = new BigInteger('8273467836243255543265432745');
This library supports the following operations:
- Basic operations such as add, divide, multiply and subtract.
- Performing modulo operations.
- Calculate the square root and power of values.
- Negate numbers
- Make numbers absolute.
- Compare numbers
Beside these operations it's also possible to make the object mutable or immutable. Performing operations on an immutable number results in the function returning a new instance.
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please create an issue in the issue tracker.
The MIT License (MIT). Please see License File for more information.