mbeckerle commented on code in PR #1571:
URL: https://github.com/apache/daffodil/pull/1571#discussion_r2411167039
##########
daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/NumericOps.scala:
##########
@@ -52,7 +57,12 @@ case object TimesDecimal extends NumericOp {
* What's questionable here, is to what number of fraction digits it will
round.
* That can be specified also as an argument to divide(), but we have no
* information here (or anywhere really) about what precision is desired.
- * So we're omitting that and just saying "round it".
+ *
+ * Due to type promotion, it's actually fairly easy to write a simple
expression
+ * that leads to this error. For example, the expression "xs:int(1) div
xs:double(.75)"
+ * promotes both args to xs:decimal, and that division leads to non-terminating
+ * decimal expansions. It is likely too difficult to require users to round
these
+ * basic expressions, so we should make a decision on how to handle this.
Review Comment:
This comment wording suggests an open TODO, ie., thta this code does not
make a decision about this.
I think the code does have a specific decision below (34 digits), so reword
to reference that.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]