decimal

Arbitrary precision floating-point decimal


Correctly-rounded arbitrary precision decimal floating-point arithmetic in PHP 7

License: MIT License

Latest releases

Version Release Download
2.0.0 2020-02-03 decimal-2.0.0.tgz
1.4.0 2021-02-17 decimal-1.4.0.tgz
1.3.1 2020-02-03 decimal-1.3.1.tgz
1.3.0 2019-02-11 decimal-1.3.0.tgz
1.2.0 2019-02-09 decimal-1.2.0.tgz
Show all releases

Changelog

Version Message
2.0.0 - Default decimal precision changed from 28 to 34.
- Decimal operations now use the **minimum** precision of all operands.
- Added `Decimal\Rational` implementation for rational numbers (fractions).
- Added `Decimal\Number` abstract class.
- Performance improvements, reduced object allocations.
- Private constructors, static initializers via `valueOf`.
1.4.0 - Added support for PHP 8 (thank you @zlodes)
- Added support for mpdecimal 2.5+
- Fixed internal exception when passing negative decimal places to toFixed
1.3.1 - Fixed abs affected by precision.
1.3.0 - Fixed sqrt of -INF returning -INF rather than NAN. #13
- Disable opcache pass 2 due to numeric string to float casts. Thanks @krakjoe
1.2.0 - Change signum of NAN returning 1, now throws RuntimeException. #10
- Change toInt of NAN and INF returning 0, now throws RuntimeException. #11
- Fix pthreads incompatibility (properly). #12
Show complete changelog