| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final long[] | T
128-bit reciprocal and normalized powers of five, stored as two 64-bit words. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static double | convertToNearestDouble(long w, int q)
Converts a decimal floating-point number |
| private static double | |
| public static double | |
| public static double | parseDouble(String s, int start, int end)
Parses a number according to the W3C "Consume a number" algorithm. |
| public static double | Returns: the number, or NaN if the substring does not consist entirely of a valid number representationParses a number according to the W3C "Consume a number" algorithm. |
| public static long |
| EXP_LIMIT | back to summary |
|---|---|
| private static final int EXP_LIMIT | |
| MAX_SIG_DIGITS | back to summary |
|---|---|
| private static final int MAX_SIG_DIGITS | |
| T | back to summary |
|---|---|
| private static final long[] T 128-bit reciprocal and normalized powers of five, stored as two 64-bit words. See "Table Generation Script" in "Number Parsing at a Gigabyte per Second" (Lemire, 2021), p. 32 | |
| CssNumberParser | back to summary |
|---|---|
| private CssNumberParser() | |
| convertToNearestDouble | back to summary |
|---|---|
| private static double convertToNearestDouble(long w, int q) Converts a decimal floating-point number Based on Algorithm 1, "Number Parsing at a Gigabyte per Second" (Lemire, 2021), p. 8, without the fallback condition; see "Fast Number Parsing Without Fallback" (Mushtak, Lemire, 2022). Precondition
| |
| normalDouble | back to summary |
|---|---|
| private static double normalDouble(long m, long p) | |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(String s) Parses a number according to the W3C "Consume a number" algorithm. A number can have integer and fractional parts, and it supports E notation (exponential).
| |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(String s, int start, int end) Parses a number according to the W3C "Consume a number" algorithm. A number can have integer and fractional parts, and it supports E notation (exponential).
| |
| tryParseDouble | back to summary |
|---|---|
| public static double tryParseDouble(String s, int start, int end) Parses a number according to the W3C "Consume a number" algorithm. A number can have integer and fractional parts, and it supports E notation (exponential).
This method operates on the substring This implementation is allocation-free for significands with less than 20 digits and returns the nearest representable double value of the input string, with ties rounding to even.
| |
| tryParseInt | back to summary |
|---|---|
| public static long tryParseInt(String s, int start, int end, int radix) Parses a number as an integer. If successful, returns the integer as a long value; otherwise
returns a long value less than | |