Careful Math (CarefulMath.sol)
View Source: contracts/CarefulMath.sol
↗ Extends: ErrorReporter ↘ Derived Contracts: Exponential
Derived from OpenZeppelin's SafeMath library https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol
Functions
mul(uint256 a, uint256 b)
div(uint256 a, uint256 b)
sub(uint256 a, uint256 b)
add(uint256 a, uint256 b)
addThenSub(uint256 a, uint256 b, uint256 c)
mul
Multiplies two numbers, returns an error on overflow.
Arguments
div
Integer division of two numbers, truncating the quotient.
Arguments
sub
Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).
Arguments
add
Adds two numbers, returns an error on overflow.
Arguments
addThenSub
add a and b and then subtract c
Arguments
Last updated