LowGasSafeMath
Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
Functions
add
Returns x + y, reverts if sum overflows uint256
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The augend |
| uint256 | The addend |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The sum of x and y |
sub
Returns x - y, reverts if underflows
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The minuend |
| uint256 | The subtrahend |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The difference of x and y |
mul
Returns x * y, reverts if overflows
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The multiplicand |
| uint256 | The multiplier |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The product of x and y |
add
Returns x + y, reverts if overflows or underflows
Parameters:
Name | Type | Description |
---|---|---|
| int256 | The augend |
| int256 | The addend |
Return Values:
Name | Type | Description |
---|---|---|
| int256 | The sum of x and y |
sub
Returns x - y, reverts if overflows or underflows
Parameters:
Name | Type | Description |
---|---|---|
| int256 | The minuend |
| int256 | The subtrahend |
Return Values:
Name | Type | Description |
---|---|---|
| int256 | The difference of x and y |
Last updated