Skip to main content

MembershipFixedMath

MembershipFixedMath

InvalidFraction

error InvalidFraction(uint256 n, uint256 d)

toFixed

function toFixed(uint256 n, uint256 d) internal pure returns (int256)

Convert some uint256 fraction n numerator / d denominator to a fixed-point number f.

Parameters

NameTypeDescription
nuint256numerator
duint256denominator

Return Values

NameTypeDescription
[0]int256fixed-point number

uintDiv

function uintDiv(uint256 u, int256 f) internal pure returns (uint256)

Divide some unsigned int u by a fixed point number f

Parameters

NameTypeDescription
uuint256unsigned dividend
fint256fixed point divisor, in FIXED_1 units

Return Values

NameTypeDescription
[0]uint256unsigned int quotient

uintMul

function uintMul(uint256 u, int256 f) internal pure returns (uint256)

Multiply some unsigned int u by a fixed point number f

Parameters

NameTypeDescription
uuint256unsigned multiplicand
fint256fixed point multiplier, in FIXED_1 units

Return Values

NameTypeDescription
[0]uint256unsigned int product

ln

function ln(int256 x) internal pure returns (int256 r)

see FixedMath0x

exp

function exp(int256 x) internal pure returns (int256 r)

see FixedMath0x