decimal

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


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

License: MIT License

Latest releases

Version Release Download
2.0.0 2020-02-03 decimal-2.0.0.tgz
1.5.0 2024-01-20 decimal-1.5.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
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.5.0 - Fix object handlers for PHP 8.3 (thank you @Majkl578)
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
Show complete changelog