Releases: brick/math
Releases Β· brick/math
0.12.1
0.12.0
π₯ Breaking changes
- Minimum PHP version is now 8.1
RoundingMode
is now anenum
; if you're type-hinting rounding modes, you need to type-hint againstRoundingMode
instead ofint
nowBigNumber
classes do not implement theSerializable
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 nowstatic
BigNumber
has a new abstract methodfrom()
- all
public
andprotected
functions ofBigNumber
are nowfinal
- the return type of
0.11.0
π₯ Breaking changes
- Minimum PHP version is now 8.0
- Methods accepting a union of types are now strongly typed*
MathException
now extendsException
instead ofRuntimeException
* 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
0.10.1
0.10.0
0.9.3
0.9.2
0.9.1
β¨ New features
BigInteger::not()
returns the bitwiseNOT
value
π Bug fixes
BigInteger::toBytes()
could return an incorrect binary representation for some numbers- The bitwise operations
and()
,or()
,xor()
onBigInteger
could return an incorrect result when the GMP extension is not available
0.9.0
π Improvements
BigNumber::of()
now accepts.123
and123.
formats, both of which return aBigDecimal
π₯ Breaking changes
- Deprecated method
BigInteger::powerMod()
has been removed - usemodPow()
instead - Deprecated method
BigInteger::parse()
has been removed - usefromBase()
instead