Releases: brick/math
0.8.7
Improvements
- Safer conversion from
float
when using custom locales - Much faster
NativeCalculator
implementation 🚀
You can expect at least a 3x performance improvement for common arithmetic operations when using the library on systems without GMP or BCMath; it gets exponentially faster on multiplications with a high number of digits. This is due to calculations now being performed on whole blocks of digits (the block size depending on the platform, 32-bit or 64-bit) instead of digit-by-digit as before.
0.8.6
0.8.5
0.8.4
0.8.3
New method
BigInteger::sqrt()
calculates the square root of a number (thanks @peter279k).
New exception
NegativeNumberException
is thrown when calling sqrt()
on a negative number.
0.8.2
0.8.1
0.8.0
Breaking changes
The following deprecated methods have been removed. Use the new method name instead:
Method removed | Replacement method |
---|---|
BigDecimal::getIntegral() |
BigDecimal::getIntegralPart() |
BigDecimal::getFraction() |
BigDecimal::getFractionalPart() |
New features
BigInteger
has been augmented with 5 new methods for bitwise operations:
New method | Description |
---|---|
and() |
performs a bitwise AND operation on two numbers |
or() |
performs a bitwise OR operation on two numbers |
xor() |
performs a bitwise XOR operation on two numbers |
shiftedLeft() |
returns the number shifted left by a number of bits |
shiftedRight() |
returns the number shifted right by a number of bits |
Thanks to @DASPRiD 👍