From d3d66ac3cb36d9b607619f64d17346e323c102f1 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Wed, 31 Aug 2022 19:57:25 -0300 Subject: [PATCH] revert unrelated changes --- contracts/utils/math/Math.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/utils/math/Math.sol b/contracts/utils/math/Math.sol index 539643b0b77..379407c42e4 100644 --- a/contracts/utils/math/Math.sol +++ b/contracts/utils/math/Math.sol @@ -169,31 +169,31 @@ library Math { // good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1; uint256 x = a; - if (x >= 1 << 128) { + if (x >> 128 > 0) { x >>= 128; result <<= 64; } - if (x >= 1 << 64) { + if (x >> 64 > 0) { x >>= 64; result <<= 32; } - if (x >= 1 << 32) { + if (x >> 32 > 0) { x >>= 32; result <<= 16; } - if (x >= 1 << 16) { + if (x >> 16 > 0) { x >>= 16; result <<= 8; } - if (x >= 1 << 8) { + if (x >> 8 > 0) { x >>= 8; result <<= 4; } - if (x >= 1 << 4) { + if (x >> 4 > 0) { x >>= 4; result <<= 2; } - if (x >= 1 << 2) { + if (x >> 2 > 0) { result <<= 1; }