mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
25 lines
529 B
Solidity
25 lines
529 B
Solidity
|
pragma solidity ^0.4.11;
|
||
|
|
||
|
/**
|
||
|
* @title Math
|
||
|
* @dev Assorted math operations
|
||
|
*/
|
||
|
|
||
|
library Math {
|
||
|
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
|
||
|
return a >= b ? a : b;
|
||
|
}
|
||
|
|
||
|
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
|
||
|
return a < b ? a : b;
|
||
|
}
|
||
|
|
||
|
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
|
||
|
return a >= b ? a : b;
|
||
|
}
|
||
|
|
||
|
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
|
||
|
return a < b ? a : b;
|
||
|
}
|
||
|
}
|