Files
uniswap-v2/contracts/libraries/Math.sol
Noah Zinsmeister b972227df8 update to solc@0.5.16
update waffle version and fix deprecations

move CI from circle to github actions
2020-01-22 11:47:24 -05:00

21 lines
441 B
Solidity

pragma solidity =0.5.16;
library Math {
function min(uint x, uint y) internal pure returns (uint z) {
z = x <= y ? x : y;
}
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
uint x = y / 2 + 1;
z = y;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}