<commit_before>var bigInt = (function() {
  var bi_base = 0x4000000; // 2^26 so there is not overflow in multiplication in the JS 2^53 ints
  function _testBase() {
    bi_base = 1000;
  }

  function BigInt (value) {
    this.value = value;
  }

  BigInt.prototype.toString = function() {
    return this.value.toString();
  };
  // string representation used in tests
  BigInt.prototype.testString = function() {
    return this.value.toString();
  };

  // simple predicates
  BigInt.prototype.isNeg = function() {
    return this.sign() < 0;
  };
  BigInt.prototype.isPos = function() {
    return this.sign() > 0;
  };
  BigInt.prototype.isZero = function() {
    return this.sign() == 0;
  };
  BigInt.prototype.isEven = function() {
    return this.isZero() || ((this.value[1] % 2) == 0);
  };
  BigInt.prototype.isOdd = function() {
    return !this.isEven();
  };

  // comparison methods
  BigInt.prototype.sign = function() {
    if (this.value[0]<0)
      return -1;
    else if (this.value[0]>0)
      return 1;
    else
      return 0;
  };
  BigInt.prototype.compareTo = function(other) {
    if (!(other instanceof BigInt)) {
      other = parseInput(other);
    }
    var result = compareInts(this.value[0], other.value[0]);
    if (result == 0) {
      for (var i=Math.abs(this.value[0]); i>=1 && result==0; i--) {
	  result = compareInts(this.value[i], other.value[i]);
      }
    }
    return result;
  };
  function compareInts(thisv, otherv) {
    if (thisv == otherv)
      return 0;
    else if (thisv < otherv) <commit_msg>part2 Fixed implementation of sign to be consistent with mathmatical definition and to make isNeg, isPos, and isZero able to use it.<commit_after>var bigInt = (function() {
  var bi_base = 0x4000000; // 2^26 so there is not overflow in multiplication in the JS 2^53 ints
  function _testBase() {
    bi_base = 1000;
  }

  function BigInt (value) {
    this.value = value;
  }

  BigInt.prototype.toString = function() {
    return this.value.toString();
  };
  // string representation used in tests
  BigInt.prototype.testString = function() {
    return this.value.toString();
  };

  // simple predicates
  BigInt.prototype.isNeg = function() {
    return this.sign() < 0;
  };
  BigInt.prototype.isPos = function() {
    return this.sign() > 0;
  };
  BigInt.prototype.isZero = function() {
    return this.sign() == 0;
  };
  BigInt.prototype.isEven = function() {
    return this.sign()==0 || ((this.value[1] % 2) == 0);
  };
  BigInt.prototype.isOdd = function() {
    return !this.isEven();
  };

  // comparison methods
  BigInt.prototype.sign = function() {
    if (this.value[0]<0)
      return -1;
    else if (this.value[0]>0)
      return 1;
    else
      return 0;
  };
  BigInt.prototype.compareTo = function(other) {
    if (!(other instanceof BigInt)) {
      other = parseInput(other);
    }
    var result = compareInts(this.value[0], other.value[0]);
    if (result == 0) {
      for (var i=Math.abs(this.value[0]); i>=1 && result==0; i--) {
	  result = compareInts(this.value[i], other.value[i]);
      }
    }
    return result;
  };
  function compareInts(thisv, otherv) {
    if (thisv == otherv)
      return 0;
    else if (thisv < otherv) 
{'fraction_non_alphanumeric': 0.15133623368551896, 'fraction_numerical': 0.024238657551274082, 'mean_word_length': 2.782608695652174, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7597718', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1081, 'n_words': 267}