decimal.js
function getBase10Exponent(x) {
    var e = x.e * LOG_BASE,
      w = x.d[0];

    // Add the number of digits of the first word of the digits array.
    for (; w >= 10; w /= 10) e++;
    return e;
  }
function getBase10Exponent(x) {
    var e = x.e * LOG_BASE,
      w = x.d[0];

    // Add the number of digits of the first word of the digits array.
    for (; w >= 10; w /= 10) e++;
    return e;
  }
function getBase10Exponent ( x ) { var e = x . e * LOG_BASE , w = x . d [ 0 ] ; // Add the number of digits of the first word of the digits array. for ( ; w >= 10 ; w /= 10 ) e ++ ; return e ; }
Calculate the base 10 exponent from the base 1e7 exponent.
Calculate the base 10 exponent from the base 1e7 exponent .