[audit]#8 handle sqrt coner case

This commit is contained in:
mingda
2020-07-08 17:59:57 +08:00
parent 3f077bfb49
commit bd26082705

View File

@@ -53,7 +53,7 @@ library SafeMath {
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
uint256 z = add(x, 1) / 2;
y = x;
while (z < y) {
y = z;