maxPower property

int maxPower

Position of first significant non zero digit.

Calculated by starting from 0 at the decimal point, first to the left, if no non zero is find on the left, then to the right.

Zeros (0, 0.0 +-0.0 etc) are the only numbers where maxPower is 0.

Implementation

int get maxPower {
  if (_dec == _zero) {
    return 0;
  }
  // Power calcs should be done on positives due to the algorithm
  decimal.Decimal decAbs = _dec.abs();
  if (decAbs < _one) {
    // pure fraction
    // multiply by 10 till >= 1.0 (not pure fraction)
    return _ltOnePower(decAbs);
  }
  return totalLen - fractLen - 1;
}