<commit_before>// Sqrt(x)

// Implement int sqrt(int x).

// Compute and return the square root of x.

/**
 * @param {number} x
 * @return {number}
 */

var mySqrt = function(x) {
    if (x === 0) return 0;
    var left = 1,
        right = Number.MAX_VALUE;
    while (true) {
        var mid = left + (right - left)/2;
        if (mid > x/mid) {
            right = mid - 1;
        } else {
            if (mid + 1 > x/(mid + 1)) return mid;
            left = mid + 1;
        }
    }
};
<commit_msg>linted<commit_after>// Sqrt(x)

// Implement int sqrt(int x).

// Compute and return the square root of x.

/**
 * @param {number} x
 * @return {number}
 */

const sqrt = function mySqrt(x) {
  if (x === 0) return 0;
  let left = 1;
  let right = Number.MAX_VALUE;
  while (true) {
    const mid = left + ((right - left) / 2);
    if (mid > x / mid) {
      right = mid - 1;
    } else {
      if (mid + 1 > x / (mid + 1)) return mid;
      left = mid + 1;
    }
  }
};

console.log(sqrt(5));

{'fraction_non_alphanumeric': 0.16649949849548645, 'fraction_numerical': 0.017051153460381142, 'mean_word_length': 1.7417582417582418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4608434', 'n_tokens_mistral': 390, 'n_tokens_neox': 367, 'n_words': 118}