docs: public static double parseDouble(final byte[] str, final int start, final int end) {
      if(start >= end) {
        throw EMPTY_STRING;
      }
      // Current position and character.
      int pos = start;
      byte cur = str[pos];
  
      // Match for NaN spellings
      if(matchNaN(str, cur, pos, end)) {
        return Double.NaN;
      }
      // Match sign
      boolean isNegative = (cur == '-');
      // Carefully consume the - character, update c and i:
      if((isNegative || (cur == '+')) && (++pos < end)) {
        cur = str[pos];
      }
      if(matchInf(str, cur, pos, end)) {
        return isNegative ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY;
      }
  
      // Begin parsing real numbers!
      if(((cur < '0') || (cur > '9')) && (cur != '.')) {
        throw NOT_A_NUMBER;
      }
  
      // Parse digits into a long, remember offset of decimal point.
      long decimal = 0;
      int decimalPoint = -1;
      while(true) {
        final int digit = cur - '0';
        if((digit >= 0) && (digit <= 9)) {
          final long tmp = (decimal << 3) + (decimal << 1) + digit;
          if(tmp >= decimal) {
            decimal = tmp; // Otherwise, silently ignore the extra digits.
          }
          else if(++decimalPoint == 0) { // Because we ignored the digit
            throw PRECISION_OVERFLOW;
          }
        }
        else if((cur == '.') && (decimalPoint < 0)) {
          decimalPoint = pos;
        }
        else { // No more digits, or a second dot.
          break;
        }
        if(++pos >= end) {
          break;
        }
        cur = str[pos];
      }
      // We need the offset from the back for adjusting the exponent:
      // Note that we need the current value of i!
      decimalPoint = (decimalPoint >= 0) ? pos - decimalPoint - 1 : 0;
  
      // Reads exponent.
      int exp = 0;
      if((pos + 1 < end) && ((cur == 'E') || (cur == 'e'))) {
        cur = str[++pos];
        final boolean isNegativeExp = (cur == '-');
        if((isNegativeExp || (cur == '+')) && (++pos < end)) {
          cur = str[pos];
        }
        if((cur < '0') || (cur > '9')) { // At least one digit required.
          throw INVALID_EXPONENT;
        }
        while(true) {
          final int digit = cur - '0';
          if(digit < 0 || digit > 9) {
            break;
          }
          exp = (exp << 3) + (exp << 1) + digit;
          if(exp > Double.MAX_EXPONENT) {
            throw EXPONENT_OVERFLOW;
          }
          if(++pos >= end) {
            break;
          }
          cur = str[pos];
        }
        exp = isNegativeExp ? -exp : exp;
      }
      // Adjust exponent by the offset of the dot in our long.
      exp = decimalPoint > 0 ? (exp - decimalPoint) : exp;
      if(pos != end) {
        throw TRAILING_CHARACTERS;
      }
  
      return BitsUtil.lpow10(isNegative ? -decimal : decimal, exp);
    }