2017-07-05 10:28:15 +00:00
|
|
|
pragma solidity ^0.4.11;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @title Math
|
|
|
|
* @dev Assorted math operations
|
|
|
|
*/
|
|
|
|
|
|
|
|
library Math {
|
2018-07-02 09:14:28 +00:00
|
|
|
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
|
2017-07-05 10:28:15 +00:00
|
|
|
return a >= b ? a : b;
|
|
|
|
}
|
|
|
|
|
2018-07-02 09:14:28 +00:00
|
|
|
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
|
2017-07-05 10:28:15 +00:00
|
|
|
return a < b ? a : b;
|
|
|
|
}
|
|
|
|
|
2018-07-02 09:14:28 +00:00
|
|
|
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
|
2017-07-05 10:28:15 +00:00
|
|
|
return a >= b ? a : b;
|
|
|
|
}
|
|
|
|
|
2018-07-02 09:14:28 +00:00
|
|
|
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
|
2017-07-05 10:28:15 +00:00
|
|
|
return a < b ? a : b;
|
|
|
|
}
|
|
|
|
}
|