We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a898b71 commit 07dfbffCopy full SHA for 07dfbff
javascript/0069-sqrtx.js
@@ -11,7 +11,7 @@ var mySqrt = function(x) {
11
let right = x;
12
13
while(left <= right) {
14
- const mid = left + Math.floor((right - left)/2);
+ const mid = (left + right) >> 1;
15
if(mid * mid <= x && (mid+1) * (mid+1) > x) return mid;
16
if(mid * mid < x) {
17
left = mid + 1;
0 commit comments