LowGasSafeMath

Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost

Functions

add

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

Returns x + y, reverts if sum overflows uint256

Parameters:

Return Values:

sub

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

Returns x - y, reverts if underflows

Parameters:

Return Values:

mul

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

Returns x * y, reverts if overflows

Parameters:

Return Values:

add

  function add(
    int256 x,
    int256 y
  ) internal pure returns (int256 z)

Returns x + y, reverts if overflows or underflows

Parameters:

Return Values:

sub

  function sub(
    int256 x,
    int256 y
  ) internal pure returns (int256 z)

Returns x - y, reverts if overflows or underflows

Parameters:

Return Values:

Last updated