PRBMathExtra

Git Source

Functions

intoSD49x28

function intoSD49x28(SD59x18 x) internal pure returns (SD49x28 result);

intoUD50x28

function intoUD50x28(UD60x18 x) internal pure returns (UD50x28 result);

max

Returns the greater of two numbers a and b

function max(UD60x18 a, UD60x18 b) internal pure returns (UD60x18);

min

Returns the lesser of two numbers a and b

function min(UD60x18 a, UD60x18 b) internal pure returns (UD60x18);

max

Returns the greater of two numbers a and b

function max(SD59x18 a, SD59x18 b) internal pure returns (SD59x18);

min

Returns the lesser of two numbers a and b

function min(SD59x18 a, SD59x18 b) internal pure returns (SD59x18);

add

Returns the sum of a and b

function add(UD60x18 a, SD59x18 b) internal pure returns (UD60x18);

sub

Returns the difference of a and b

function sub(UD60x18 a, SD59x18 b) internal pure returns (UD60x18);

max

Returns the greater of two numbers a and b

function max(UD50x28 a, UD50x28 b) internal pure returns (UD50x28);

min

Returns the lesser of two numbers a and b

function min(UD50x28 a, UD50x28 b) internal pure returns (UD50x28);

max

Returns the greater of two numbers a and b

function max(SD49x28 a, SD49x28 b) internal pure returns (SD49x28);

min

Returns the lesser of two numbers a and b

function min(SD49x28 a, SD49x28 b) internal pure returns (SD49x28);

add

Returns the sum of a and b

function add(UD50x28 a, SD49x28 b) internal pure returns (UD50x28);

sub

Returns the difference of a and b

function sub(UD50x28 a, SD49x28 b) internal pure returns (UD50x28);

roundToNearestUD60x18

Rounds an UD50x28 to the nearest UD60x18

function roundToNearestUD60x18(UD50x28 value) internal pure returns (UD60x18 result);

Errors

SD59x18_IntoSD49x28_Overflow

error SD59x18_IntoSD49x28_Overflow(SD59x18 x);

UD60x18_IntoUD50x28_Overflow

error UD60x18_IntoUD50x28_Overflow(UD60x18 x);