Skip to main content

UncheckedMath

internal function _uncheckedIncrement

Increments an unsigned integer by one without checking the result for overflow errors (using safe math).

function _uncheckedIncrement(uint256 i) internal pure returns (uint256)
InputTypeDescription
iuint256The number to be incremented.
Output
0uint256The number incremented by one.

internal function _uncheckedAdd

Adds two unsigned integers without checking the result for overflow errors (using safe math).

function _uncheckedAdd(uint256 a, uint256 b) internal pure returns (uint256)
InputTypeDescription
auint256The first summand.
buint256The second summand.
Output
0uint256The sum.

internal function _uncheckedSub

Subtracts two unsigned integers without checking the result for overflow errors (using safe math).

function _uncheckedSub(uint256 a, uint256 b) internal pure returns (uint256)
InputTypeDescription
auint256The minuend.
buint256The subtrahend.
Output
0uint256The difference.
© 2024