Details
Description
BigDecimal scale is mis-interpreted as being identical to exponent, resulting in incorrect number conversion. According to java doc for BigDecimal the value is: unscaledValue × 10^(-scale), whereas for openfast DecimalValue the value is: mantissa x 10^(exponent). Therefore exponent = -bigDecimal.scale (and not bigDecimal.scale).
To test this, encode BigDecimal(2.4) then decode the byte stream and you'll get 240 (24 x 10^1, but should be 24 x 10^(-1)).
Attachments
Issue Links
- is duplicated by
-
FAST-37 BigDecimal constructor for DecimalValue incorrectly sets the exponent
- Resolved