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 29883 - [Qt3Ts] fo-test-d3e4625, fo-test-d3e4630
Summary: [Qt3Ts] fo-test-d3e4625, fo-test-d3e4630
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-29 15:11 UTC by Tim Mills
Modified: 2016-10-25 14:05 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2016-09-29 15:11:48 UTC
Using .NET, I get math:tan(math:pi() div 2) to be

16331778728383844.0

and abs($result - 1.633123935319537E16)

to be

539375188474.0.

Are these tests correct?


   <test-case name="fo-test-d3e4625">
      <description>Test case for math:tan</description>
      <created by="generate-qt3-test-set.xsl" on="2016-09-26"/>
      <environment ref="global"/>
      <test>
        math:tan(math:pi() div 2)
      </test>
      <result>
         <assert>abs($result - 1.633123935319537E16) lt 1e-5</assert>
      </result>
   </test-case>

   <test-case name="fo-test-d3e4630">
      <description>Test case for math:tan</description>
      <created by="generate-qt3-test-set.xsl" on="2016-09-26"/>
      <environment ref="global"/>
      <test>
        math:tan(-math:pi() div 2)
      </test>
      <result>
         <assert>abs($result - -1.633123935319537E16) lt 1e-5</assert>
      </result>
   </test-case>
Comment 1 Michael Kay 2016-10-25 14:05:08 UTC
The problem is that the "approximately" flag in the markup generates a test for small differences, whereas here the difference between the actual result and the true mathematical result (infinity) is huge.

I propose to change the text in the spec to:

1 div math:tan(math:pi() div 2) returns 0.0e0 (approximately). Mathematically, tan(π/2) is positive infinity. But because math:pi() div 2 returns an approximation, the result of math:tan(math:pi() div 2) will be a large but finite number.

and similarly for the negative case.

The test that is generated will then test that abs(1 div math:tan(math:pi() div 2)) - 0.0e0 is less than some epsilon.

I have changed the stylesheet that generates the tests to produce stable names, which are needed for the QT3 results reporting process (as this compares reported test results against the current test catalog).