SafeMath (SafeMath.sol)
View Source: openzeppelin-solidity/contracts/math/SafeMath.sol
SafeMath
Unsigned math operations with safety checks that revert on error
Functions
mul
Multiplies two unsigned integers, reverts on overflow.
function mul(uint256 a, uint256 b) internal pure
returns(uint256)
Arguments
Name
Type
Description
a
uint256
b
uint256
div
Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
function div(uint256 a, uint256 b) internal pure
returns(uint256)
Arguments
Name
Type
Description
a
uint256
b
uint256
sub
Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
function sub(uint256 a, uint256 b) internal pure
returns(uint256)
Arguments
Name
Type
Description
a
uint256
b
uint256
add
Adds two unsigned integers, reverts on overflow.
function add(uint256 a, uint256 b) internal pure
returns(uint256)
Arguments
Name
Type
Description
a
uint256
b
uint256
mod
Divides two unsigned integers and returns the remainder (unsigned integer modulo), reverts when dividing by zero.
function mod(uint256 a, uint256 b) internal pure
returns(uint256)
Arguments
Name
Type
Description
a
uint256
b
uint256
Last updated
Was this helpful?