Skip to content

Incorrect BigDecimal fraction representation (2.9 -> 2.10 change) #139

@wlukowicz

Description

@wlukowicz

According to the spec, decimal fractions (tag 4) of value m * 10^e should be represented as a tagged array containing the exponent e and the mantissa m. However, Jackson writes BigDecimals as tagged arrays containing their scale and unscaled value. The difference being that the value of BigDecimal is unscaled value * 10^-scale, which means the scale is the opposite of the exponent e.

The spec gives an example how 273.15 should be represented:

C4             -- Tag 4
   82          -- Array of length 2
      21       -- -2
      19 6AB3  -- 27315

Here is the actual representation:

C4             -- Tag 4
   82          -- Array of length 2
      02       -- 2
      19 6AB3  -- 27315

Metadata

Metadata

Assignees

No one assigned

    Labels

    cborcompatibilityChange that has compatibility aspects (possible breakage)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions