Skip to content

Commit d1c8612

Browse files
address uint(-1) failure case
closes #48
1 parent f04890e commit d1c8612

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/libraries/Math.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ library Math {
77

88
function sqrt(uint y) internal pure returns (uint z) {
99
if (y > 3) {
10-
uint x = (y + 1) / 2;
10+
uint x = y / 2 + 1;
1111
z = y;
1212
while (x < z) {
1313
z = x;

0 commit comments

Comments
 (0)