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.

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.

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.

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.

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.

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