This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3610 - Test fn-avgflt2args-1 answers are incorrect
Summary: Test fn-avgflt2args-1 answers are incorrect
Status: RESOLVED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-21 12:59 UTC by John Snelson
Modified: 2006-08-31 14:01 UTC (History)
0 users

See Also:


Attachments

Description John Snelson 2006-08-21 12:59:50 UTC
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.
Comment 1 Andrew Eisenberg 2006-08-22 17:17:59 UTC
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.
Comment 2 John Snelson 2006-08-22 17:43:53 UTC
Thanks. I've made a comment against the F&O spec in bug #3615.
Comment 3 John Snelson 2006-08-28 10:04:50 UTC
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.
Comment 4 Carmelo Montanez 2006-08-30 14:31:17 UTC
All:

Pending resoltion from the Working Group, I will leave this bug open for the time being.

Thanks,
Carmelo
Comment 5 Carmelo Montanez 2006-08-31 14:01:44 UTC
John:

Thanks for the comment.  I added the extra possible expected value as allowed by the Working Group decision.

Thanks,
Carmelo