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.

Parameters:

  • a: uint to convert into a FixedPoint.

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

Whether a is equal to b.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Whether a is equal to b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Whether a is greater than b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Whether a is greater than b.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Whether a is greater than b.

Parameters:

  • a: a uint256.

  • b: a FixedPoint.

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

Whether a is greater than or equal to b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Whether a is greater than or equal to b.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Whether a is greater than or equal to b.

Parameters:

  • a: a uint256.

  • b: a FixedPoint.

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

Whether a is less than b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Whether a is less than b.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Whether a is less than b.

Parameters:

  • a: a uint256.

  • b: a FixedPoint.

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

Whether a is less than or equal to b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Whether a is less than or equal to b.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Whether a is less than or equal to b.

Parameters:

  • a: a uint256.

  • b: a FixedPoint.

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

The minimum of a and b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

The maximum of a and b.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Adds two `Unsigned`s, reverting on overflow.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

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

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Subtracts two `Unsigned`s, reverting on overflow.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Subtracts an unscaled uint256 from an Unsigned, reverting on overflow.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Subtracts an Unsigned from an unscaled uint256, reverting on overflow.

Parameters:

  • a: a uint256.

  • b: a FixedPoint.

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

Multiplies two `Unsigned`s, reverting on overflow.

This will "floor" the product.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Multiplies an Unsigned and an unscaled uint256, reverting on overflow.

This will "floor" the product.

Parameters:

  • a: a FixedPoint.

  • b: a uint256.

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

Multiplies two `Unsigned`s and "ceil’s" the product, reverting on overflow.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Multiplies an Unsigned and an unscaled uint256 and "ceil’s" the product, reverting on overflow.

Parameters:

  • a: a FixedPoint.

  • b: a FixedPoint.

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

Divides one Unsigned by an Unsigned, reverting on overflow or division by 0.

This will "floor" the quotient.

Parameters:

  • a: a FixedPoint numerator.

  • b: a FixedPoint denominator.

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

Divides one Unsigned by an unscaled uint256, reverting on overflow or division by 0.

This will "floor" the quotient.

Parameters:

  • a: a FixedPoint numerator.

  • b: a uint256 denominator.

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

Divides one unscaled uint256 by an Unsigned, reverting on overflow or division by 0.

This will "floor" the quotient.

Parameters:

  • a: a uint256 numerator.

  • b: a FixedPoint denominator.

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

Divides one Unsigned by an Unsigned and "ceil’s" the quotient, reverting on overflow or division by 0.

Parameters:

  • a: a FixedPoint numerator.

  • b: a FixedPoint denominator.

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

Divides one Unsigned by an unscaled uint256 and "ceil’s" the quotient, reverting on overflow or division by 0.

Parameters:

  • a: a FixedPoint numerator.

  • b: a uint256 denominator.

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

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

This will "floor" the result.

Parameters:

  • a: a FixedPoint numerator.

  • b: a uint256 denominator.

© UMA Project 2018-2019