Releases: PaulRBerg/prb-math
Releases · PaulRBerg/prb-math
v3.0.0
Changed
- Breaking: Refactor the libraries into free functions and user defined value types (
a69b4b
) (@PaulRBerg) - Breaking: Set minimum compiler pragma to
>=0.8.13
(a69b4b
) (@PaulRBerg) - Breaking: Rename
SCALE
toUNIT
(4d3658
) (@PaulRBerg) - Always truncate instead of rounding up in multiplication functions (21fb32) (@PaulRBerg)
- Change license to MIT (@PaulRBerg)
- Check if
y
is zero ingm
(5b585c
) (@PaulRBerg) - Optimize
avg
by using the SWAR technique (#89) (@PaulRBerg) - Optimize
div
andmulDivSigned
by wrapping unary operations in unchecked blocks (a69b4b
) (@PaulRBerg) - Optimize
exp2
by batching bit checks (#77) (@k06a) - Optimize
msb
by using assembly (#135) (@t4sk, @PaulRBerg) - Optimize result assignment in
powu
(673802) (@PaulRBerg) - Rename
fromInt
totoSD59x18
andtoInt
tofromSD59x18
(a69b4b
) (@PaulRBerg) - Rename
fromUint
totoUD60x18
andtoUint
tofromUD60x18
(a69b4b
) (@PaulRBerg) - Rename
mostSignificantBit
tomsb
(a69b4b
) (@PaulRBerg) - Rename
mulDivFixedPoint
tomulDiv18
(4c5430
) (@PaulRBerg) - Rename
PRBMath.sol
toCore.sol
(1b82ea
) (@PaulRBerg) - Rename shared
sqrt
inprbSqrt
(1b82ea
) (@PaulRBerg) - Rename shared
exp2
inprbExp2
(1b82ea
) (@PaulRBerg) - Revert with inputs instead of computed value custom errors (@PaulRBerg)
- Return base if exponent is one in
pow
(977d43
) (@PaulRBerg) - Format mathematical expressions using LaTeX (@PaulRBerg)
- Improve wording and formatting in comments, NatSpec documentation, and README (@PaulRBerg)
Added
- Add constants for E and PI (
422d87
) (@PaulRBerg) - Add simple PRBTest-based typed assertions for testing in Foundry (
ddb084
) (@PaulRBerg) - Add user defined value types
SD59x18
andUD60x18
(@PaulRBerg) - Implement conversion and helper functions for the user defined value types (@PaulRBerg)
Removed
- Breaking: Delete the
e
andpi
functions (422d87) (@PaulRBerg) - Breaking: Remove JavaScript SDK and all paraphernalia (
1b82ea
) (@PaulRBerg)
Fixed
- Fix incorrect hard-coded value in
sqrt
(#91) (@Amxx, @nonergodic) - Fix upper boundary specified in
exp
NatSpec comments (#119) (@PaulRBerg)
v2.5.0
v2.4.3
v2.4.2
v2.4.1
v2.4.0
Added
@ethersproject/bignumber
,decimal.js
,evm-bn
, andmathjs
as normal deps.- Ship JavaScript source maps with the npm package.
Changed
- Americanize spellings in NatSpec comments.
- Move everything from the
prb-math.js
package toprb-math
. - Polish NatSpec comments in
avg
function. - Use underscores in number literals.
Fixed
- Bug in
powu
function in thePRBMathSD59x18
contract, which caused the result to be positive even if the base was negative. - Minor bug in
avg
function in thePRBMathSD59x18
contract, which rounded down the result instead of up when the intermediary sum was negative.
v2.3.0
v2.2.0
v2.1.0
Added
- Solidity v0.8.4 custom errors.
Changed
- Define the upper limit as
MAX_UD60x18 / SCALE
in thesqrt
function. - Define
xValue
var to avoid readingx.value
multiple times. - Move
SCALE > prod1
check at the top of themulDivFixedPoint
function. - Refer to
add
function operands as summands. - Refer to
sub
function operands as minuend and subtrahend. - Rename
rUnsigned
var torAbs
. - Set minimum compiler version to 0.8.4.
- Use
MIN_SD59x18
instead oftype(int256).min
where appropriate.
Removed
hardhat/console.sol
import.- Stale caveat in
sqrt
function NatSpec.
v2.0.1
Changed
- Mention the new typed flavors in the README.
Fixed
- Code snippet for the UD60x18Typed consumer in the README.
- English typos in NatSpec comments.
- Minor bug in
log10
inPRBMathUD60x18Typed.sol
which made the result inaccurate when the input was a multiple of 10.