Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP 7.
- PHP 7
- libmpdec 2.4
sudo apt-get install libmpdec-dev
pecl install decimal
git clone [email protected]:php-decimal/extension ext-decimal
cd ext-decimal
phpize
./configure
make
sudo make install
You can do this temporarily using php -dextension=decimal.so
or by adding extension=decimal.so
to your INI. If you manage PHP with phpbrew, you can use phpbrew ext enable decimal
.
php run-tests.php -P -q