Brick\Math v0.8.8 Release Notes
Release Date: 2019-04-25 // about 5 years ago-
🐛 🐛 Bug fixes
BigInteger::toBase()
could return an empty string for zero values (BCMath & Native calculators only, GMP calculator unaffected)
🆕 ✨ New features
BigInteger::toArbitraryBase()
converts a number to an arbitrary base, using a custom alphabetBigInteger::fromArbitraryBase()
converts a string in an arbitrary base, using a custom alphabet, back to a number
These methods can be used as the foundation to convert strings between different bases/alphabets, using BigInteger as an intermediate representation.
🗄 💩 Deprecations
- 🗄
BigInteger::parse()
is now deprecated in favour offromBase()
📜
BigInteger::fromBase()
works the same way asparse()
, with 2 minor differences:- 0️⃣ the
$base
parameter is required, it does not default to10
- it throws a
NumberFormatException
instead of anInvalidArgumentException
when the number is malformed