Math (Math.sol)
View Source: openzeppelin-solidity/contracts/math/Math.sol
Math
Assorted math operations
Functions
max
Returns the largest of two numbers.
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
min
Returns the smallest of two numbers.
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
average
Calculates the average of two numbers. Since these are integers, averages of an even and odd number cannot be represented, and will be rounded down.
Arguments
Name | Type | Description |
a | uint256 | |
b | uint256 |
Last updated