prb-math
Advanced tools
Changelog
[2.4.1] - 2021-10-27
@ethersproject/bignumber
v5.5.0 (@PaulRBerg)Changelog
[2.4.0] - 2021-10-20
@ethersproject/bignumber
, decimal.js
, evm-bn
, and mathjs
as normal deps (@PaulRBerg)prb-math.js
package to prb-math
(@PaulRBerg)avg
function (@PaulRBerg)powu
function of the PRBMathSD59x18
contract, which caused the result to be positive even if the base was negative (@PaulRBerg)avg
function of the PRBMathSD59x18
contract, which rounded down the result instead of up when the intermediary sum was
negative (@PaulRBerg)Changelog
[2.3.0] - 2021-09-18
package.json
(@PaulRBerg)Changelog
[2.2.0] - 2021-06-27
@param
tags in custom errors' NatSpec (@PaulRBerg)Changelog
[2.1.0] - 2021-06-27
MAX_UD60x18 / SCALE
in the sqrt
function (@PaulRBerg)xValue
var to avoid reading x.value
multiple times (@PaulRBerg)SCALE > prod1
check at the top of the mulDivFixedPoint
function (@PaulRBerg)add
function operands as summands (@PaulRBerg)sub
function operands as minuend and subtrahend (@PaulRBerg)rUnsigned
var to rAbs
(@PaulRBerg)>=0.8.4
(@PaulRBerg)MIN_SD59x18
instead of type(int256).min
where appropriate (@PaulRBerg)hardhat/console.sol
import (@PaulRBerg)sqrt
(@PaulRBerg)Changelog
[2.0.1] - 2021-06-16
log10
in PRBMathUD60x18Typed.sol
which made the result inaccurate when the input was a multiple of 10 (@PaulRBerg)Changelog
[2.0.0] - 2021-06-14
PRBMathCommon.sol
to PRBMath.sol
(@PaulRBerg)exp2
by using the 192.64-bit format instead of 128.128-bit (@PaulRBerg)pow
functions (@PaulRBerg)exp
and exp2
(@PaulRBerg)add
and sub
functions in the typed libraries (@PaulRBerg)PRBMathSD59x18Typed.sol
and PRBMathUD60x18Typed.sol
(@PaulRBerg)fromInt
, fromUint
, pow
, toInt
and toUInt
(@PaulRBerg)PRBMath.SD59x18
and PRBMath.UD60x18
, simple wrappers to indicate that the variables are fixed-point numbers (@PaulRBerg)log10
which made the result incorrect when the input was not a multiple of 10 (@PaulRBerg)Changelog
[1.1.0] - 2021-05-07
This release was yanked because it was accidentally published with the wrong version number.
pow
function to powu
(@PaulRBerg)exp2
by simplifying the integer part calculations (@PaulRBerg)fromInt
and toInt
in PRBMathSD59x18.sol
(@PaulRBerg)fromUint
and toUint
in PRBMathUD60x18.sol
(@PaulRBerg)mulDivSigned
in PRBMathCommon.sol
(@PaulRBerg)pow
in PRBMathSD59x18.sol
and PRBMathUD60x18.sol
(@PaulRBerg)