Skip to content

Releases: php-decimal/ext-decimal

v2.0.1

11 Apr 22:44

Choose a tag to compare

Decimal v2.0.1

Stable release of the ext-decimal PHP extension with Rational number support.

(Version bumped from 2.0.0 which was previously published on PECL as alpha.)

Changes since v1.x

  • Default decimal precision changed from 28 to 34 to match Decimal128.
  • Decimal operations now use the minimum precision of all operands, rather than the maximum.
  • Added Decimal\Rational implementation for rational numbers (fractions).
  • Added Decimal\Number abstract number class.
  • Added Decimal\Precision interface.
  • Added Decimal\Decimal::reduce method.
  • Renamed toSci to toScientific.
  • Removed signum and parity methods.
  • Better consistency around scientific notation when converting to string or JSON.
  • Precision is now applied on operations only (input is preserved).
  • Decimal constructors are now private — must use \Decimal\Number::valueOf.
  • Performance improvements, reduced object allocations.
  • PHP 8.2, 8.3, and 8.4 compatibility.
  • Fixed isPositive/isNegative to return false for zero values.
  • Fixed array/debug output for Decimal and Rational objects.

Requirements

  • PHP >= 8.2
  • libmpdec

Install

pecl install decimal

or via PIE:

pie install php-decimal/ext-decimal

v2.0.0

11 Apr 22:42

Choose a tag to compare

Decimal v2.0.0

Stable release of the ext-decimal PHP extension with Rational number support.

Changes

  • Default decimal precision changed from 28 to 34 to match Decimal128.
  • Decimal operations now use the minimum precision of all operands, rather than the maximum.
  • Added Decimal\Rational implementation for rational numbers (fractions).
  • Added Decimal\Number abstract number class.
  • Added Decimal\Precision interface.
  • Added Decimal\Decimal::reduce method.
  • Renamed toSci to toScientific.
  • Removed signum and parity methods.
  • Better consistency around scientific notation when converting to string or JSON.
  • Precision is now applied on operations only (input is preserved).
  • Decimal constructors are now private — must use \Decimal\Number::valueOf.
  • Performance improvements, reduced object allocations.
  • PHP 8.2, 8.3, and 8.4 compatibility.
  • Fixed isPositive/isNegative to return false for zero values.
  • Fixed array/debug output for Decimal and Rational objects.

Requirements

  • PHP >= 8.2
  • libmpdec

Install

pecl install decimal-2.0.0.tgz

or via PIE:

pie install php-decimal/ext-decimal

v2.0.0-alpha

30 Jun 09:44

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.4.0...v2.0.1-alpha

v1.5.0

30 Jun 08:58

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.4.0...v1.5.0

v1.3.0

30 Jun 08:57

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.3.1...v1.4.0

v2.0.0-alpha

30 Jun 09:43

Choose a tag to compare

v1.3.0

30 Jun 08:57

Choose a tag to compare

Full Changelog: v1.2.0...v1.3.0

What's Changed

New Contributors

Full Changelog: v1.3.0...v1.3.1

v1.3.0

30 Jun 08:57

Choose a tag to compare

Full Changelog: v1.2.0...v1.3.0

v1.2.0

09 Feb 11:25

Choose a tag to compare

  • 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

v1.1.2

09 Feb 11:24

Choose a tag to compare

This version should not be used in a ZTS environment. Please use 1.2.0 instead.