Skip to main content

FixedMath0x

FixedMath0x

LnTooLarge

error LnTooLarge(int256 x)

Thrown when the natural log function is given too large of an argument

LnNonRealResult

error LnNonRealResult(int256 x)

Thrown when the natural log would have returned a number outside of ℝ

ExpTooLarge

error ExpTooLarge(int256 x)

Thrown when exp is given too large of an argument

UnsignedValueTooLarge

error UnsignedValueTooLarge(uint256 x)

Thrown when an unsigned value is too large to be converted to a signed value

FIXED_1

int256 FIXED_1

LN_MAX_VAL

int256 LN_MAX_VAL

LN_MIN_VAL

int256 LN_MIN_VAL

EXP_MAX_VAL

int256 EXP_MAX_VAL

EXP_MIN_VAL

int256 EXP_MIN_VAL

ln

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

Get the natural logarithm of a fixed-point number 0 < x <= LN_MAX_VAL

exp

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

Compute the natural exponent for a fixed-point number EXP_MIN_VAL <= x <= 1