DecimalMath.sol

View Source: contracts/libraries/DecimalMath.sol

DecimalMath

Contract Members

Constants & Variables

uint256 internal constant e18;

Functions

mul

This function multiplies two decimals represented as (decimal 10*DECIMALS)

function mul(uint256 x, uint256 y) internal pure
returns(z uint256)

Returns

uint256 Result of multiplication represented as (decimal 10*DECIMALS)

Arguments

Name

Type

Description

x

uint256

y

uint256

div

This function divides two decimals represented as (decimal 10*DECIMALS)

function div(uint256 x, uint256 y) internal pure
returns(z uint256)

Returns

uint256 Result of division represented as (decimal 10*DECIMALS)

Arguments

Name

Type

Description

x

uint256

y

uint256