This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The test is: fn:avg((xs:float("-3.4028235E38"),xs:float("-3.4028235E38"))) the test result required is: -INF but I think that "-3.4028235E38" should also be allowed as a valid answer. This would allow an XQuery implementation to use an average function with greater precision, and seems to fall within the limits of the spec. This new result is still within the limits imposed on xs:float datatypes.
While it might be desirable to be able to use greater precision in the calaculation of fn:avg, I believe that the F&O specification does not allow us this flexibility. Section 15.4.2, fn:avg, of F&O says in part: "Otherwise, returns the average of the values computed as sum($arg) div count($arg)." Section 15.4.5, fn:sum, requires that a sum of xs:float values returns xs:float, saying in part: "For numeric values, the numeric promotion rules defined in 6.2 Operators on Numeric Values are used to promote all values to a single common type. The sum of a sequence of integers will therefore be an integer, while the sum of a numeric sequence that includes at least one xs:double will be an xs:double." I believe that your comment is a comment on F&O more than it is on the test suite itself. I encourage you to submit it on this spec (instructions in the front matter of F&O). The XML Query and XSL WGs are meeting this week and will consider any comments that you submit.
Thanks. I've made a comment against the F&O spec in bug #3615.
The working group has voted to accept changes along the lines of those I have requested. I believe that means that this now qualifies as an actual bug in the test suite.
All: Pending resoltion from the Working Group, I will leave this bug open for the time being. Thanks, Carmelo
John: Thanks for the comment. I added the extra possible expected value as allowed by the Working Group decision. Thanks, Carmelo