double value; the supported syntax is compatible with
Double#valueOf(String).
Syntax
Leading and trailing whitespace characters in str are ignored.
Whitespace is removed as if by the java. method;
that is, characters in the range [U+0000,U+0020].
The rest of str should constitute a Java FloatingPointLiteral
as described by the lexical syntax rules shown below:
- FloatingPointLiteral:
- [Sign]
NaN- [Sign]
Infinity- [Sign] DecimalFloatingPointLiteral
- [Sign] HexFloatingPointLiteral
- SignedInteger
- HexFloatingPointLiteral:
- HexSignificand BinaryExponent [FloatTypeSuffix]
- HexSignificand:
- HexNumeral
- HexNumeral
.0x[HexDigits].HexDigits0X[HexDigits].HexDigits
- BinaryExponent:
- BinaryExponentIndicator SignedInteger
- BinaryExponentIndicator:
pP
- DecimalFloatingPointLiteral:
- DecSignificand [DecExponent] [FloatTypeSuffix]
- DecSignificand:
- IntegerPart
.[FractionPart].FractionPart- IntegerPart
- IntegerPart:
- Digits
- FractionPart:
- Digits
- DecExponent:
- ExponentIndicator SignedInteger
- ExponentIndicator:
- e
- E
- SignedInteger:
- [Sign] Digits
- Sign:
- +
- -
- Digits:
- Digit {Digit}
- Digit:
- (one of)
0 1 2 3 4 5 6 7 8 9
- HexNumeral:
0xHexDigits0XHexDigits
- HexDigits:
- HexDigit {HexDigit}
- HexDigit:
- (one of)
0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F
- FloatTypeSuffix:
- (one of)
f F d D
Expected character lengths for values produced by Double#toString:
DecSignificand (IntegerPart + FractionPart):
1 to 17 digitsIntegerPart: 1 to 7 digitsFractionPart: 1 to 16 digitsSignedInteger in exponent: 1 to 3 digitsFloatingPointLiteral: 1 to 24 characters, e.g. "-1.2345678901234568E-300"FloatingPointLiteral with or without white space around it:
Integer#MAX_VALUE - 4 = 2,147,483,643 characters.References:
| Modifier and Type | Field and Description |
|---|---|
| private static final JavaDoubleBitsFromByteArray | |
| private static final JavaDoubleBitsFromCharArray | |
| private static final JavaDoubleBitsFromCharSequence |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static double | Returns: the parsed valuethe string to be parsed str)Convenience method for calling |
| public static double | Returns: the parsed valuethe string to be parsed str, int the start offset of the offset, int FloatingPointLiteral in strthe length of length)FloatingPointLiteral in strParses a |
| public static double | Returns: the parsed valuethe string to be parsed, a byte array with characters
in ISO-8859-1, ASCII or UTF-8 encoding str)Convenience method for calling |
| public static double | Returns: the parsed valuethe string to be parsed, a byte array with characters
in ISO-8859-1, ASCII or UTF-8 encoding str, int The index of the first byte to parse offset, int The number of bytes to parse length)Parses a |
| public static double | Returns: the parsed valuethe string to be parsed str)Convenience method for calling |
| public static double | Returns: the parsed valuethe string to be parsed, a byte array with characters
in ISO-8859-1, ASCII or UTF-8 encoding str, int The index of the first character to parse offset, int The number of characters to parse length)Parses a |
| BYTE_ARRAY_PARSER | back to summary |
|---|---|
| private static final JavaDoubleBitsFromByteArray BYTE_ARRAY_PARSER | |
| CHAR_ARRAY_PARSER | back to summary |
|---|---|
| private static final JavaDoubleBitsFromCharArray CHAR_ARRAY_PARSER | |
| CHAR_SEQUENCE_PARSER | back to summary |
|---|---|
| private static final JavaDoubleBitsFromCharSequence CHAR_SEQUENCE_PARSER | |
| JavaDoubleParser | back to summary |
|---|---|
| private JavaDoubleParser() Don't let anyone instantiate this class. | |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(CharSequence str) throws NumberFormatException Convenience method for calling
| |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(CharSequence str, int offset, int length) throws NumberFormatException Parses a
| |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(byte[] str) throws NumberFormatException Convenience method for calling
| |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(byte[] str, int offset, int length) throws NumberFormatException Parses a
| |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(char[] str) throws NumberFormatException Convenience method for calling
| |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(char[] str, int offset, int length) throws NumberFormatException Parses a
See
| |