refactor max and min out of SafeMath

pull/288/head
Francisco Giordano 8 years ago
parent a66f5f8f03
commit ba383a6d20
  1. 24
      contracts/math/Math.sol
  2. 17
      contracts/math/SafeMath.sol

@ -0,0 +1,24 @@
pragma solidity ^0.4.11;
/**
* @title Math
* @dev Assorted math operations
*/
contract 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;
}
}

@ -29,21 +29,4 @@ library SafeMath {
assert(c >= a);
return c;
}
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;
}
}

Loading…
Cancel
Save