address uint(-1) failure case

closes #48
This commit is contained in:
Noah Zinsmeister
2020-01-21 12:28:26 -05:00
parent f04890ef4c
commit d1c8612ea3

View File

@ -7,7 +7,7 @@ library Math {
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
uint x = (y + 1) / 2;
uint x = y / 2 + 1;
z = y;
while (x < z) {
z = x;