Skip to content

Releases: brick/math

0.11.0

15 Jan 23:17

Choose a tag to compare

πŸ’₯ 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

10 Aug 22:54
459f278

Choose a tag to compare

πŸ‘Œ Improvements

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

0.10.1

01 Aug 22:56

Choose a tag to compare

✨ New features

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

0.10.0

18 Jun 12:57

Choose a tag to compare

πŸ’₯ Breaking changes

  • Minimum PHP version is now 7.4

0.9.3

15 Aug 20:52

Choose a tag to compare

πŸš€ 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

20 Jan 23:13

Choose a tag to compare

πŸ› 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

19 Aug 08:41

Choose a tag to compare

✨ 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.9.0

18 Aug 10:00

Choose a tag to compare

πŸ‘Œ Improvements

  • BigNumber::of() now accepts .123 and 123. formats, both of which return a BigDecimal

πŸ’₯ Breaking changes

  • Deprecated method BigInteger::powerMod() has been removed - use modPow() instead
  • Deprecated method BigInteger::parse() has been removed - use fromBase() instead

0.8.17

19 Aug 08:33

Choose a tag to compare

πŸ› 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

0.8.16

18 Aug 09:04

Choose a tag to compare

πŸš‘ Critical fix

  • This version reintroduces the deprecated BigInteger::parse() method, that has been removed by mistake in version 0.8.9 and should have lasted for the whole 0.8 release cycle.

✨ New features

  • BigInteger::modInverse() calculates a modular multiplicative inverse
  • BigInteger::fromBytes() creates a BigInteger from a byte string
  • BigInteger::toBytes() converts a BigInteger to a byte string
  • BigInteger::randomBits() creates a pseudo-random BigInteger of a given bit length
  • BigInteger::randomRange() creates a pseudo-random BigInteger between two bounds

πŸ’© Deprecations

  • BigInteger::powerMod() is now deprecated in favour of modPow()