Releases: brick/math
Releases · brick/math
0.14.3
0.14.2
🗑️ Deprecations
- Passing
floatvalues toof()or arithmetic methods is deprecated and will be removed in 0.15; cast to string explicitly to preserve the previous behaviour (#105) - Accessing
RoundingModeenum cases through upper snake case (e.g.HALF_UP) is deprecated, use the pascal case version (e.g.HalfUp) instead - Method
BigInteger::gcdMultiple()is deprecated, usegcdAll()instead - Method
BigDecimal::exactlyDividedBy()is deprecated, usedividedByExact()instead - Method
BigDecimal::getIntegralPart()is deprecated (will be removed in 0.15, and re-introduced as returningBigIntegerin 0.16) - Method
BigDecimal::getFractionalPart()is deprecated (will be removed in 0.15, and re-introduced as returningBigDecimalwith a different meaning in 0.16) - Method
BigRational::nd()is deprecated, useofFraction()instead - Method
BigRational::quotient()is deprecated, usegetIntegralPart()instead - Method
BigRational::remainder()is deprecated, use$number->getNumerator()->remainder($number->getDenominator())instead - Method
BigRational::quotientAndRemainder()is deprecated, use$number->getNumerator()->quotientAndRemainder($number->getDenominator())instead
✨ New features
- New method:
BigInteger::gcdAll()(replacesgcdMultiple()) - New method:
BigRational::clamp() - New method:
BigRational::ofFraction()(replacesnd()) - New method:
BigRational::getIntegralPart()(replacesquotient()) - New method:
BigRational::getFractionalPart()
👌 Improvements
BigInteger::modInverse()now acceptsBigNumber|int|float|stringinstead of justBigIntegerBigInteger::gcdMultiple()now acceptsBigNumber|int|float|stringinstead of justBigInteger
🐛 Bug fixes
BigInteger::clamp()andBigDecimal::clamp()now throw an exception on inverted bounds, instead of returning an incorrect result
0.14.1
0.14.0
✨ New features
- New methods:
BigInteger::clamp()andBigDecimal::clamp()(#96 by @JesterIruka)
✨ Improvements
- All pure methods in
BigNumberclasses are now marked as@purefor better static analysis
💥 Breaking changes
- Minimum PHP version is now 8.2
BigNumberclasses are nowreadonlyBigNumberis now marked as sealed: it must not be extended outside of this package- Exception classes are now
final
0.13.1
0.13.0
💥 Breaking changes
BigDecimal::ofUnscaledValue()no longer throws an exception if the scale is negativeMathExceptionnow extendsRuntimeExceptioninstead ofException; this reverts the change introduced in version0.11.0(#82)
✨ New features
BigDecimal::ofUnscaledValue()allows a negative scale (and converts the values to create a zero scale number)
0.12.3
0.12.2
0.12.1
0.12.0
💥 Breaking changes
- Minimum PHP version is now 8.1
RoundingModeis now anenum; if you're type-hinting rounding modes, you need to type-hint againstRoundingModeinstead ofintnowBigNumberclasses do not implement theSerializableinterface anymore (they use the new custom object serialization mechanism)- The following breaking changes only affect you if you're creating your own
BigNumbersubclasses:- the return type of
BigNumber::of()is nowstatic BigNumberhas a new abstract methodfrom()- all
publicandprotectedfunctions ofBigNumberare nowfinal
- the return type of