ePosn = doubleString.indexOf('e');
assert (ePosn != -1) : "no E or e in approximate numeric";
// there is a limit on the length of a floatingpoint literal in DB2
if (doubleString.length() > MAX_FLOATINGPOINT_LITERAL_LENGTH)
{if (true) throw new StandardException("Floating point literal too long");}
// if there is no '.' before the e, put one in
dotPosn = doubleString.substring(0,ePosn).indexOf('.');
if (dotPosn == -1) {
doubleImage.insert(ePosn,'.');
doubleString = doubleImage.toString();
ePosn++;
}
try
{
doubleValue = Double.valueOf(doubleString);
}
catch (NumberFormatException nfe)
{
{if (true) throw new StandardException("Invalid double", nfe);}
}
double dv = doubleValue.doubleValue();
// When the value is 0 it's possible rounded, try to detect it by checking if the mantissa is 0.0
// "proof of correctness": any nonzero value (mantissa) with less than 30 characters will not be
// rounded to 0.0 by a float/real. This correctly detects the case when
// the radix/exponent being "too small" (1e-900) giving a value rounded to zero.
if ( (dv == 0.0d) && (Double.parseDouble(doubleString.substring(0, ePosn-1)) != 0.0d) )
{
{if (true) throw new StandardException("Floating point exponent underflow");}
}
if (Double.isNaN(dv) || Double.isInfinite(dv))
{if (true) throw new StandardException("Floating point exponent overflow");}
{if (true) return (ValueNode)nodeFactory.getNode(NodeTypes.DOUBLE_CONSTANT_NODE,
doubleValue,
parserContext);}
break;