FixedPoint

fromUnscaledUint(uint256 a) → struct FixedPoint.Unsigned internal

Constructs an Unsigned from an unscaled uint, e.g., b=5 gets stored internally as 5**18.

isEqual(struct FixedPoint.Unsigned a, uint256 b) → bool internal

Whether a is equal to b.

isEqual(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → bool internal

Whether a is equal to b.

isGreaterThan(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → bool internal

Whether a is greater than b.

isGreaterThan(struct FixedPoint.Unsigned a, uint256 b) → bool internal

Whether a is greater than b.

isGreaterThan(uint256 a, struct FixedPoint.Unsigned b) → bool internal

Whether a is greater than b.

isGreaterThanOrEqual(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → bool internal

Whether a is greater than or equal to b.

isGreaterThanOrEqual(struct FixedPoint.Unsigned a, uint256 b) → bool internal

Whether a is greater than or equal to b.

isGreaterThanOrEqual(uint256 a, struct FixedPoint.Unsigned b) → bool internal

Whether a is greater than or equal to b.

isLessThan(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → bool internal

Whether a is less than b.

isLessThan(struct FixedPoint.Unsigned a, uint256 b) → bool internal

Whether a is less than b.

isLessThan(uint256 a, struct FixedPoint.Unsigned b) → bool internal

Whether a is less than b.

isLessThanOrEqual(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → bool internal

Whether a is less than or equal to b.

isLessThanOrEqual(struct FixedPoint.Unsigned a, uint256 b) → bool internal

Whether a is less than or equal to b.

isLessThanOrEqual(uint256 a, struct FixedPoint.Unsigned b) → bool internal

Whether a is less than or equal to b.

min(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Returns the min of a and b.

max(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Returns the max of a and b.

add(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Adds two `Unsigned`s, reverting on overflow.

add(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned internal

Adds an Unsigned to an unscaled uint, reverting on overflow.

sub(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Subtracts two `Unsigned`s, reverting on underflow.

sub(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned internal

Subtracts an unscaled uint from an Unsigned, reverting on underflow.

sub(uint256 a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Subtracts an Unsigned from an unscaled uint, reverting on underflow.

mul(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Multiplies two `Unsigned`s, reverting on overflow.

mul(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned internal

Multiplies an Unsigned by an unscaled uint, reverting on overflow.

mulCeil(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Multiplies two `Unsigned`s, reverting on overflow, and ceil’s the resultant product rather than the default floor behavior.

mulCeil(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned internal

div(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Divides with truncation two `Unsigned`s, reverting on overflow or division by 0.

div(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned internal

Divides with truncation an Unsigned by an unscaled uint, reverting on division by 0.

divCeil(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Divides with truncation two `Unsigned`s, reverting on overflow or division by 0, and ceil’s the resultant product rather than the default floor behavior.

divCeil(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned internal

div(uint256 a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned internal

Divides with truncation an unscaled uint by an Unsigned, reverting on overflow or division by 0.

pow(struct FixedPoint.Unsigned a, uint256 b) → struct FixedPoint.Unsigned output internal

Raises an Unsigned to the power of an unscaled uint, reverting on overflow. E.g., b=2 squares a.

© UMA Project 2018-2019