Skip to content

Releases: brick/math

0.13.1

29 Mar 13:51
Compare
Choose a tag to compare

✨ Improvements

  • __toString() methods of BigInteger and BigDecimal are now type-hinted as returning numeric-string instead of string (#90 by @vudaltsov)

0.13.0

03 Mar 13:22
Compare
Choose a tag to compare

πŸ’₯ Breaking changes

  • BigDecimal::ofUnscaledValue() no longer throws an exception if the scale is negative
  • MathException now extends RuntimeException instead of Exception; this reverts the change introduced in version 0.11.0 (#82)

✨ New features

  • BigDecimal::ofUnscaledValue() allows a negative scale (and converts the values to create a zero scale number)

0.12.3

28 Feb 13:12
Compare
Choose a tag to compare

✨ New features

  • BigDecimal::getPrecision() returns the number of significant digits in a decimal number

0.12.2

26 Feb 10:24
Compare
Choose a tag to compare

⚑️ Performance improvements

  • Division in NativeCalculator is now faster for small divisors, thanks to @Izumi-kun in #87

πŸ‘Œ Improvements

  • Add missing RoundingNecessaryException to the @throws annotation of BigNumber::of()

0.12.1

29 Nov 23:22
Compare
Choose a tag to compare

⚑️ Performance improvements

0.12.0

26 Nov 14:45
Compare
Choose a tag to compare

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

15 Jan 23:17
Compare
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
Compare
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
Compare
Choose a tag to compare

✨ New features

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

0.10.0

18 Jun 12:57
Compare
Choose a tag to compare

πŸ’₯ Breaking changes

  • Minimum PHP version is now 7.4