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.
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
div
Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
sub
Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
add
Adds two unsigned integers, reverts on overflow.
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.
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
Last updated