Math Versions Save

Arbitrary-precision arithmetic library for PHP

0.12.1

5 months ago

⚡️ Performance improvements

  • BigNumber::of() is now faster, thanks to @SebastienDug in #77.

0.12.0

5 months ago

💥 Breaking changes

  • Minimum PHP version is now 8.1
  • RoundingMode is now an enum; if you're type-hinting rounding modes, you need to type-hint against RoundingMode instead of int now
  • BigNumber classes do not implement the Serializable interface anymore (they use the new custom object serialization mechanism)
  • The following breaking changes only affect you if you're creating your own BigNumber subclasses:
    • the return type of BigNumber::of() is now static
    • BigNumber has a new abstract method from()
    • all public and protected functions of BigNumber are now final

0.11.0

1 year ago

💥 Breaking changes

  • Minimum PHP version is now 8.0
  • Methods accepting a union of types are now strongly typed*
  • MathException now extends Exception instead of RuntimeException

* You may now run into type errors if you were passing Stringable objects to of() or any of the methods internally calling of(), with strict_types enabled. You can fix this by casting Stringable objects to string first.

0.10.2

1 year ago

👌 Improvements

  • BigRational::toFloat() now simplifies the fraction before performing division (#73) thanks to @olsavmic

0.10.1

1 year ago

New features

  • BigInteger::gcdMultiple() returns the GCD of multiple BigInteger numbers

0.10.0

1 year ago

💥 Breaking changes

  • Minimum PHP version is now 7.4

0.9.3

2 years ago

🚀 Compatibility with PHP 8.1

  • Support for custom object serialization; this removes a warning on PHP 8.1 due to the Serializable interface being deprecated (#60) thanks @TRowbotham

0.9.2

3 years ago

:bug: Bug fix

  • Incorrect results could be returned when using the BCMath calculator, with a default scale set with bcscale(), on PHP >= 7.2 (#55).

0.9.1

3 years ago

✨ New features

  • BigInteger::not() returns the bitwise NOT value

🐛 Bug fixes

  • BigInteger::toBytes() could return an incorrect binary representation for some numbers
  • The bitwise operations and(), or(), xor() on BigInteger could return an incorrect result when the GMP extension is not available

0.8.17

3 years ago

🐛 Bug fix

  • BigInteger::toBytes() could return an incorrect binary representation for some numbers
  • The bitwise operations and(), or(), xor() on BigInteger could return an incorrect result when the GMP extension is not available