This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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>
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).