code: function parse(Dec, dec) {
    if (dec === 0 && 1 / dec < 0) dec = '-0';
    assert(Decimal.NUMERIC.test(dec += ''), 'Invalid number.');
  
    let e, i, l;
    Dec.s = dec.charAt(0) == '-' ? (dec = dec.slice(1), -1) : 1;
    if ((e = dec.indexOf('.')) > -1) dec = dec.replace('.', '');
  
    if ((i = dec.search(/e/i)) > 0) {
      if (e < 0) e = i;
      e += +dec.slice(i + 1);
      dec = dec.substring(0, i);
    } else if (e < 0) {
      e = dec.length;
    }
  
    l = dec.length;
  
    for (i = 0; i < l && dec.charAt(i) == '0';) ++i;
  
    if (i == l) {
      Dec.c = [Dec.e = 0];
    } else {
      for (; l > 0 && dec.charAt(--l) == '0';);
      Dec.e = e - i - 1;
      Dec.c = [];
      for (e = 0; i <= l;) Dec.c[e++] = +dec.charAt(i++);
    }
  
    return Dec;
  }
docs: Helper