Skip to content

Commit e95fee5

Browse files
authored
uptake latest fast double parser code (#806)
1 parent 7b5172d commit e95fee5

39 files changed

+1916
-443
lines changed

src/main/java/com/fasterxml/jackson/core/io/doubleparser/AbstractFloatValueParser.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
package com.fasterxml.jackson.core.io.doubleparser;
1111

1212
/**
13-
* Abstract base class for parsers that parse a {@code FloatValue} from a
13+
* Abstract base class for parsers that parse a {@code FloatingPointLiteral} from a
1414
* character sequence ({@code str}).
1515
* <p>
1616
* This is a C++ to Java port of Daniel Lemire's fast_double_parser.
@@ -32,6 +32,20 @@
3232
* </dl>
3333
*/
3434
abstract class AbstractFloatValueParser {
35+
/**
36+
* This return value indicates that the input value is not a legal
37+
* production of the syntax rule for a float value.
38+
* <p>
39+
* The value is {@code -1L}.
40+
* <p>
41+
* Converting this value to a floating point number using
42+
* {@code Double.longBitsToDouble(-1L)}, or
43+
* {@code Float.intBitsToFloat((int) -1L)} yields a {@code NaN}.
44+
* <p>
45+
* Although this number yields {@code NaN}, the bit pattern of this value is
46+
* intentionally different from {@link Double#NaN}, and {@link Float#NaN}.
47+
*/
48+
final static long PARSE_ERROR = -1L;
3549
final static long MINIMAL_NINETEEN_DIGIT_INTEGER = 1000_00000_00000_00000L;
3650
/**
3751
* The decimal exponent of a double has a range of -324 to +308.
@@ -72,6 +86,4 @@ abstract class AbstractFloatValueParser {
7286
AbstractFloatValueParser.CHAR_TO_HEX_MAP[ch] = AbstractFloatValueParser.DECIMAL_POINT_CLASS;
7387
}
7488
}
75-
76-
7789
}

0 commit comments

Comments
 (0)