Details
-
Type: Bug
-
Status: Open
-
Priority: Default
-
Resolution: Unresolved
-
Affects Version/s: 1.0.0
-
Fix Version/s: None
-
Component/s: Message Object Model
-
Labels:None
Description
It seems to me that there should be a minus sign added to the exponent in DecimalValue(BigDecimal bigDecimal) constructor:
public DecimalValue(BigDecimal bigDecimal)
{ this.mantissa = bigDecimal.unscaledValue().longValue(); this.exponent = bigDecimal.scale(); }should be replaced with:
public DecimalValue(BigDecimal bigDecimal)
{ this.mantissa = bigDecimal.unscaledValue().longValue(); this.exponent = -bigDecimal.scale(); }This is because toBigDecimal() function reverses sign of exponent:
public BigDecimal toBigDecimal()
{ return new BigDecimal(BigInteger.valueOf(mantissa), -exponent); }