You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/03/15 16:34:48 UTC
[GitHub] [incubator-daffodil] mbeckerle commented on a change in pull
request #196: Use setScale() not round() when rounding BigDecimals
mbeckerle commented on a change in pull request #196: Use setScale() not round() when rounding BigDecimals
URL: https://github.com/apache/incubator-daffodil/pull/196#discussion_r266057931
##########
File path: daffodil-test/src/test/resources/org/apache/daffodil/section23/dfdl_functions/Functions.tdml
##########
@@ -4324,6 +4324,8 @@
</xs:complexType>
</xs:element>
+ <xs:element name="ceil08" type="xs:decimal" dfdl:inputValueCalc="{ fn:ceiling(xs:decimal(0.125)) }"/>
Review comment:
You can test my theory about the side-effect of setScale by creating a test with two elements. The first is a bigDecimal type with a fractional part. The second is dfdl:inputValueCalc=".... access first element and round it....". If setScale modifies the object, then BOTH elements will have had the scale set.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services