Length of multi-precision int (aka long) in digits.
190822
def _len_int(obj):
    '''
    '''
    if obj:
        n, i = 1, abs(obj)
        if i > _digitmax:
             # no log(x[, base]) in Python 2.2
            n += int(log(i) * _digitlog)
    else:  # zero
        n = 0
    return n
1275451
def _value_length(self, value, t):
        """"""

        if isinstance(value, int):
            fmt = '<%s' % (type_codes[t])
            output = struct.pack(fmt, value)
            return len(output)
        elif isinstance(value, str):
            return len(value) + 1  # Account for final 0

        len_accum = 0
        for x in value:
            len_accum += self._value_length(x, t)

        return len_accum
1192886
function getLengthOfLength(lenValue, indefiniteLength) {
  var lenOfLen;
  
  if (indefiniteLength) {
    lenOfLen = 3;
  } else if (lenValue > 0x00FFFFFF) {
    lenOfLen = 5;
  } else if (lenValue > 0x0000FFFF) {
    lenOfLen = 4;
  } else if (lenValue > 0x000000FF) {
    lenOfLen = 3;
  } else if (lenValue > 0x0000007F) {
    lenOfLen = 2; 
  } else {
    lenOfLen = 1;
  }
  
  return lenOfLen
}
809179
public static int lenVarInt(long longVal) {
        if (longVal == 0) {
            return 0;
        }
        if (longVal <  0) longVal = -longVal;
        if (longVal < (1L << (7 * 1 - 1))) return 1;  // 6  bits
        if (longVal < (1L << (7 * 2 - 1))) return 2;  // 13 bits
        if (longVal < (1L << (7 * 3 - 1))) return 3;  // 20 bits
        if (longVal < (1L << (7 * 4 - 1))) return 4;  // 27 bits
        if (longVal < (1L << (7 * 5 - 1))) return 5;  // 34 bits
        if (longVal < (1L << (7 * 6 - 1))) return 6;  // 41 bits
        if (longVal < (1L << (7 * 7 - 1))) return 7;  // 48 bits
        if (longVal < (1L << (7 * 8 - 1))) return 8;  // 55 bits
        if (longVal < (1L << (7 * 9 - 1))) return 9;  // 62 bits
        return 10;
    }
916223
function INT(max_len) {
        if (typeof max_len === "undefined") { max_len = Number.MAX_VALUE; }
        return _make_alias('INT', paka.P.INT, CONCAT(OPT(OR('+', '-')), REPEAT(DIGIT(), 1, max_len)));
    }
804512
private long[][] getLongitude( String longi ) {

        float secs = Float.parseFloat("0" + longi.substring(5)) * 60.f;
        long nom = (long) (secs * 1000);

        long[][] longl = new long[][]{{Long.parseLong(longi.substring(0, 3)), 1}, {Long.parseLong(longi.substring(3, 5)), 1},
                {nom, 1000}};

        return longl;
    }
1012103
function len(srcObj) {
      if (isObj(srcObj)) {
        return keys(srcObj).length;
      }
      else if (typeOf(srcObj, 'str', 'arr', 'fun') || get(srcObj, 'length', 'num')) {
        return srcObj.length;
      }
      else return -1;
    }
147399
function(n){

        // Examine international prefix
        if(n.substr(0,2) === '61'){
            return n.length === 11;
        }

        // Examine international prefix
        if(n.substr(0,4) === '0061'){
            return n.length === 13;
        }

        // Examine number of digits
        return n.length === 10;
    }
18246
def read_long(self, signed=True):
        """"""
        return int.from_bytes(self.read(8), byteorder='little', signed=signed)
135024
public static long buff2long(byte[] bs, int offset) {
        return (((long) (bs[offset] >= 0 ? bs[offset] : 256 + bs[offset])) << 56)
                | (((long) (bs[offset + 1] >= 0 ? bs[offset + 1] : 256 + bs[offset + 1])) << 48)
                | (((long) (bs[offset + 2] >= 0 ? bs[offset + 2] : 256 + bs[offset + 2])) << 40)
                | (((long) (bs[offset + 3] >= 0 ? bs[offset + 3] : 256 + bs[offset + 3])) << 32)
                | (((long) (bs[offset + 4] >= 0 ? bs[offset + 4] : 256 + bs[offset + 4])) << 24)
                | (((long) (bs[offset + 5] >= 0 ? bs[offset + 5] : 256 + bs[offset + 5])) << 16)
                | (((long) (bs[offset + 6] >= 0 ? bs[offset + 6] : 256 + bs[offset + 6])) << 8)
                | (bs[offset + 7] >= 0 ? bs[offset + 7] : 256 + bs[offset + 7]);
    }
1105565
private static int appendLong(byte[] data, int offset, long value) {
        offset = appendByte(data, offset, value >>> 56);
        offset = appendByte(data, offset, value >>> 48);
        offset = appendByte(data, offset, value >>> 40);
        offset = appendByte(data, offset, value >>> 32);
        offset = appendInt(data, offset, value);
        return offset;
    }
520867
private static int bigDigitLength(BigInteger b) {
        /*
         * Same idea as the long version, but we need a better
         * approximation of log10(2). Using 646456993/2^31
         * is accurate up to max possible reported bitLength.
         */
        if (b.signum == 0)
            return 1;
        int r = (int)((((long)b.bitLength() + 1) * 646456993) >>> 31);
        return b.compareMagnitude(bigTenToThe(r)) < 0? r : r+1;
    }
1110069
def round_to_int(number, precision):
    """"""
    precision = int(precision)
    rounded = (int(number) + precision / 2) // precision * precision
    return rounded
551790
def _si(number):
    """"""
    prefixes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
    while number > 1024:
        number /= 1024.0
        prefixes.pop(0)
    return '%0.2f%s' % (number, prefixes.pop(0))
363757
public long getPrecision() {
    switch (type) {
      case OLDDECIMAL:
      case DECIMAL:
        //DECIMAL and OLDDECIMAL are  "exact" fixed-point number.
        //so :
        // - if can be signed, 1 byte is saved for sign
        // - if decimal > 0, one byte more for dot
        if (isSigned()) {
          return length - ((decimals > 0) ? 2 : 1);
        } else {
          return length - ((decimals > 0) ? 1 : 0);
        }
      default:
        return length;
    }
  }
42507
private static int parseMillis(Input s) {
    if (s.index < s.len && s.getChar() == '.') {
      int startIndex = ++s.index;
      int ms = parseInt(s);
      int len = s.index - startIndex;
      for (; len < 3; len++) ms *= 10;
      for (; len > 3; len--) ms /= 10; // truncate because it's easier than rounding.
      return ms;
    }
    return 0;
  }
601577
private static int calcLongStrLength(long posValue)
    {
        int len = 10;
        long comp = TEN_BILLION_L;

        // 19 is longest, need to worry about overflow
        while (posValue >= comp) {
            if (len == 19) {
                break;
            }
            ++len;
            comp = (comp << 3) + (comp << 1); // 10x
        }
        return len;
    }