Math

Functions

min

function min(uint256 x, uint256 y) internal pure returns (uint256 z);

min128

function min128(uint128 x, uint128 y) internal pure returns (uint128 z);

min

function min(int256 x, int256 y) internal pure returns (int256 z);

max

function max(uint256 x, uint256 y) internal pure returns (uint256 z);

max

function max(int256 x, int256 y) internal pure returns (int256 z);

max128

function max128(uint128 x, uint128 y) internal pure returns (uint128 z);

clip128

function clip128(uint128 x, uint128 y) internal pure returns (uint128);

clip

function clip(uint256 x, uint256 y) internal pure returns (uint256);

divFloor

function divFloor(uint256 x, uint256 y) internal pure returns (uint256);

divCeil

function divCeil(uint256 x, uint256 y) internal pure returns (uint256);

mulFloor

function mulFloor(uint256 x, uint256 y) internal pure returns (uint256);

mulCeil

function mulCeil(uint256 x, uint256 y) internal pure returns (uint256);

invFloor

function invFloor(uint256 x) internal pure returns (uint256);

invCeil

function invCeil(uint256 denominator) internal pure returns (uint256 z);

mulDivFloor

function mulDivFloor(uint256 x, uint256 y, uint256 k) internal pure returns (uint256 result);

mulDivCeil

function mulDivCeil(uint256 x, uint256 y, uint256 k) internal pure returns (uint256 result);

mulDivDown

function mulDivDown(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 z);

mulDivUp

function mulDivUp(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 z);

mulDown

function mulDown(uint256 x, uint256 y) internal pure returns (uint256);

mulUp

function mulUp(uint256 x, uint256 y) internal pure returns (uint256);

divDown

function divDown(uint256 x, uint256 y) internal pure returns (uint256);

divUp

function divUp(uint256 x, uint256 y) internal pure returns (uint256);

scale

function scale(uint8 decimals) internal pure returns (uint256);

ammScaleToTokenScale

function ammScaleToTokenScale(uint256 amount, uint256 scaleFactor, bool ceil) internal pure returns (uint256 z);

tokenScaleToAmmScale

function tokenScaleToAmmScale(uint256 amount, uint256 scaleFactor) internal pure returns (uint256);

abs32

function abs32(int32 x) internal pure returns (uint32);

abs

function abs(int256 x) internal pure returns (uint256);

sqrt

function sqrt(uint256 x) internal pure returns (uint256 z);

floorD8Unchecked

Floor of a D8 number without checking overflow in the cast to int32.

function floorD8Unchecked(int256 val) internal pure returns (int32);

Last updated