belongs in number utils or charutil?
14620
public long parseLong(char[] arr, int start, int end) {
    long x = 0;
    boolean negative = arr[start] == '-';
    for (int i=negative ? start+1 : start; i<end; i++) {
      // If constructing the largest negative number, this will overflow
      // to the largest negative number.  This is OK since the negation of
      // the largest negative number is itself in two's complement.
      x = x * 10 + (arr[i] - '0');
    }
    // could replace conditional-move with multiplication of sign... not sure
    // which is faster.
    return negative ? -x : x;
  }
1062245
def special_number?(literal)
      literal.is_a?(Sass::Script::Value::String) && literal.value =~ /(calc|var)\(/
    end
1359099
function getNumber (type, min, max, format, options) {
  var ret;

  // Juggle the arguments if the user didn't supply a format string
  if (!options) {
    options = format;
    format = null;
  }

  if (type === 'int') {
    ret = utils.randomInt(min, max);
  } else if (type === 'float') {
    ret = utils.randomFloat(min, max);
  }

  if (typeof options.hash.round === 'number') {
    ret = Math.round(ret / options.hash.round) * options.hash.round;
  }

  if (format) {
    ret = numbro(ret).format(format);
  }

  return ret;
}
69075
function encodeNumber_(num) {
  let encodedNumber = '';
  while (num >= 0x20) {
    encodedNumber += CHAR64_.charAt(
      0x20 | (num & 0x1f));
    num >>= 5;
  }
  encodedNumber += CHAR64_.charAt(num);
  return encodedNumber;
}
906389
function(num) {
    num = parseInt(num);

    if (num < 10) {
      num = '0' + num;
    } else {
      num = num.toString();
    }

    return num;
  }
757788
private static Object toExternalNumber( Object value)
    {
    Class<?> valueType =
      value == null
      ? null
      : value.getClass();

    return
      !(valueType != null && Number.class.isAssignableFrom( valueType))?
      null :

      valueType.equals( BigDecimal.class)?
      toExternalNumber( (BigDecimal) value) :

      valueType.equals( Long.class)?
      toExternalNumber( new BigDecimal( (Long) value)) :

      value;      
    }
1226363
def number(self):
        """"""
        number = ''
        while self.char is not None and self.char.isdigit():
            number += self.char
            self.advance()

        if self.char == '.':
            number += self.char
            self.advance()

            while self.char is not None and self.char.isdigit():
                number += self.char
                self.advance()

            token = Token(Nature.FLOAT_NUMBER, number)

        else:
            token = Token(Nature.INT_NUMBER, number)

        return token
374409
def numval(token):
    """"""
    if token.type == 'INTEGER':
        return int(token.value)
    elif token.type == 'FLOAT':
        return float(token.value)
    else:
        return token.value
1038855
function convertOnes(num) {
  if (str(num).length > 1) {
    throw new Error("Must have at most 1 digit");
  }

  num = int(num);
  return mapOnes[num];
}
1322489
def englishToPun_number(number):
    
    output = ''
    number = list(str(number))
    for digit in number:
        output += DIGITS[int(digit)]
    return output
920877
def make_number(value, lineno, type_=None):
    
    return symbols.NUMBER(value, type_=type_, lineno=lineno)
1224265
def of number
      raise_on_type_mismatch number
      digits = convert_number_to_digits(number)

      sum    = digits.reverse.map.with_index do |digit, idx|
        idx.even? ? (digit * 2).divmod(10).reduce(&:+) : digit
      end.reduce(&:+)

      (10 - sum % 10) % 10
    end
1197886
function checkNumberOrInterpolation(i) {
  const start = i;
  let l;

  while (i < tokensLength) {
    if (l = checkInterpolation(i) || checkNumber(i)) i += l;
    else break;
  }

  return i - start;
}
761611
void expectNumberOrSymbol(Node n, JSType type, String msg) {
    if (!type.matchesNumberContext() && !type.matchesSymbolContext()) {
      mismatch(n, msg, type, NUMBER_SYMBOL);
    }
  }
1109726
function parseNumber (inp) {
    var res = "";
    if (inp.takeAPeek("-")) res += "-";
  
    var match = parseInteger(inp);
    if (match) res += match;
  
    match = parseFraction(inp);
    if (match) res += match;
  
    if (res && res !== "-") {
      match = parseExponent(inp);
      if (match) res += match;
    }
  
    if (res === "-") syntaxError(inp, "Expected number");
    return res || null;
  }
1177594
function parseNumber( str ) {
	var v = parseFloat( str );
	if ( isnan( v ) ) {
		return new TypeError( 'invalid value. Unable to parse string as a number. Value: `' + str + '`.' );
	}
	return v;
}
637734
private boolean isInt(String str) {
        try {
            Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }