Add JsonParser.getNumberValueExact()
to allow precision-retaining buffer
#631
Milestone
JsonParser.getNumberValueExact()
to allow precision-retaining buffer
#631
There are a few databind issues:
BigDecimal
numbers jackson-databind#1770BigDecimal
precision not retained for polymorphic deserialization jackson-databind#2644that seem to be caused by buffering code that reads floating-point values as
Double
s, leading to loss of precision for JSON (and other textual formats), and possibly issues with NaN values as well.But it seems like there might be a simple fix: if, in case of buffering, there was a method similar to
getNumberValue()
but that would useBigDecimal
in case of floating-point values (to preserve exact value and precision, since that is 10-based), that would solve the problem.Conversely formats (mostly binary formats) that have concrete/physical representations of 2-based floating-point values could and should still return
double
/float
values as appropriate: change would only occur in cases where precision loss is possible.The text was updated successfully, but these errors were encountered: