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 18477 - [QT3] different results for some atan2 test cases
Summary: [QT3] different results for some atan2 test cases
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: 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: 2012-08-02 21:44 UTC by Andrew Eisenberg
Modified: 2012-09-25 20:24 UTC (History)
0 users

See Also:


Attachments

Description Andrew Eisenberg 2012-08-02 21:44:18 UTC
I am seeing different results for a number of atan2 test cases:

- math-atan2-005
  math:atan2(-1, -0.0e0)
  actual: 3.14159265358979
  expected: -math:pi() div 2
  excel: 3.141592654

- math-atan2-006
  math:atan2(+1, 0.0e0)
  actual: 0
  expected: +math:pi() div 2
  excel: 0

- math-atan2-007
  math:atan2(-0.0e0, -1)
  actual: -1.5707963267949
  expected: -math:pi()
  excel: -1.570796327

- math-atan2-008
  math:atan2(+0.0e0, -1)
  actual: -1.5707963267949
  expected: +math:pi()
  excel: -1.570796327

- math-atan2-009
  math:atan2(-0.0e0, +1)
  actual: 1.5707963267949
  expected: -0.0e0
  excel: 1.570796327

- math-atan2-010
  math:atan2(+0.0e0, +1)
  actual: 1.5707963267949
  expected: +0.0e0
  excel: 1.570796327
Comment 1 O'Neil Delpratt 2012-09-25 14:17:56 UTC
Please may you check your implementation. Some libraries including excel use atan2(x,y) where as our specification uses atan2(y,x). Does this account for the discrepancies?
Comment 2 Andrew Eisenberg 2012-09-25 20:24:42 UTC
As you had guessed, the library that I am using defines atan2(x,y). Thanks for pointing this out to me.