code: function bitSize(x) {
    var j, z, w;
    for (j=x.length-1; (x[j]==0) && (j>0); j--);
    for (z=0, w=x[j]; w; (w>>=1), z++);
    z+=bpe*j;
    return z;
  }
docs: returns how many bits long the bigInt is, not counting leading zeros.