private double completeCalculation() { if (charsIndex == 0 || (charsIndex == 1 && chars[0] == '-')) { // "" or "-" strictError(); // Strict requires at least one digit. return 0.0; // Treated as 0.0 (not -0.0) in non-strict. } else if (isExponent((byte) chars[charsIndex - 1])) { // Covers 12.0efrog strictError(); addExponentToResult(adjustExponent); } else if (isStrict && !isEOS()) { strictError(); // We know it is not whitespace at this point } else if (!wroteExponent && adjustExponent != 0) { addToResult((byte) 'E'); addExponentToResult(adjustExponent); } return SafeDoubleParser.parseDouble(new String(chars, 0, charsIndex)); }
private double completeCalculation() { if (charsIndex == 0 || (charsIndex == 1 && chars[0] == '-')) { // "" or "-" strictError(); // Strict requires at least one digit. return 0.0; // Treated as 0.0 (not -0.0) in non-strict. } else if (isExponent((byte) chars[charsIndex - 1])) { // Covers 12.0efrog strictError(); addExponentToResult(adjustExponent); } else if (isStrict && !isEOS()) { strictError(); // We know it is not whitespace at this point } else if (!wroteExponent && adjustExponent != 0) { addToResult((byte) 'E'); addExponentToResult(adjustExponent); } return SafeDoubleParser.parseDouble(new String(chars, 0, charsIndex)); }
private double completeCalculation() { if (charsIndex == 0 || (charsIndex == 1 && chars[0] == '-')) { // "" or "-" strictError(); // Strict requires at least one digit. return 0.0; // Treated as 0.0 (not -0.0) in non-strict. } else if (isExponent((byte) chars[charsIndex - 1])) { // Covers 12.0efrog strictError(); addExponentToResult(adjustExponent); } else if (isStrict && !isEOS()) { strictError(); // We know it is not whitespace at this point } else if (!wroteExponent && adjustExponent != 0) { addToResult((byte) 'E'); addExponentToResult(adjustExponent); } return SafeDoubleParser.parseDouble(new String(chars, 0, charsIndex)); }
addExponentToResult(exponent); wroteExponent = true; return isEOS(); // Exponent end of double...let's finish.
addExponentToResult(exponent); wroteExponent = true; return isEOS(); // Exponent end of double...let's finish.
addExponentToResult(exponent); wroteExponent = true; return isEOS(); // Exponent end of double...let's finish.
addExponentToResult(exponent); wroteExponent = true; return isEOS(); // Exponent end of double...let's finish.
private double completeCalculation() { if (charsIndex == 0 || (charsIndex == 1 && chars[0] == '-')) { // "" or "-" strictError(); // Strict requires at least one digit. return 0.0; // Treated as 0.0 (not -0.0) in non-strict. } else if (isExponent((byte) chars[charsIndex - 1])) { // Covers 12.0efrog strictError(); addExponentToResult(adjustExponent); } else if (isStrict && !isEOS()) { strictError(); // We know it is not whitespace at this point } else if (!wroteExponent && adjustExponent != 0) { addToResult((byte) 'E'); addExponentToResult(adjustExponent); } return SafeDoubleParser.parseDouble(new String(chars, 0, charsIndex)); }