<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1400" rel="nofollow">http://projects.scipy.org/numpy/ticket/1400</a> on 2010-02-18 by trac user ChristianMarquardt, assigned to unknown.</em></p>
<p dir="auto">When compiling numpy-1.4.0 with the Sun Studio Compilers (v12 Update 1) on Linux (an OpenSUSE 11.1 in my case), about 30 tests in numpy.test() fail; all failures are related to the arctan2 function.</p>
<p dir="auto">I've found that in r7732 a patch was applied to trunk/numpy/core/src/private/npy_config.h in response to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7728768" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1799" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1799/hovercard" href="https://github.com/numpy/numpy/issues/1799">#1799</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7728770" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1800" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1800/hovercard" href="https://github.com/numpy/numpy/issues/1800">#1800</a>, and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7728772" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1801" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1801/hovercard" href="https://github.com/numpy/numpy/issues/1801">#1801</a>, #undef'ing the HAVE_ATAN2 variable in order to fix a broken atan2() implementation on Solaris. This does no good with the SunStudio 12.1 compiler on Linux, though; it apparently only works without failures with HAVE_ATAN2 defined.</p>
<p dir="auto">The attached patch ensures that the original patch is only applied on Sun platforms (i.e., not on Linux). If applied, all tests are completed successfully under Linux. BTW, I did not observe <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7728773" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1802" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1802/hovercard" href="https://github.com/numpy/numpy/issues/1802">#1802</a> or <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7728775" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1803" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1803/hovercard" href="https://github.com/numpy/numpy/issues/1803">#1803</a>...</p>
<p dir="auto">I have no access to a Solaris machine, so I don't know if the original patch (which was for Sun workshop 6 - I think that's not available any more) is required with Sun Studio 12.1 at all.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1824" rel="nofollow">http://projects.scipy.org/numpy/ticket/1824</a> on 2011-05-08 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rgommers/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rgommers">@rgommers</a>, assigned to unknown.</em></p>
<p dir="auto">Reported by Ilan Schell on Solaris:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="======================================================================
FAIL: test_zero_nzero (test_umath.TestArctan2SpecialValues)
----------------------------------------------------------------------
Traceback (most recent call last):
 File &quot;/home/demo/master/lib/python2.7/site-packages/numpy/core/tests/test_umath.py&quot;,
line 322, in test_zero_nzero
   assert_almost_equal(ncu.arctan2(np.PZERO, np.NZERO), np.pi)
 File &quot;/home/demo/master/lib/python2.7/site-packages/numpy/testing/utils.py&quot;,
line 468, in assert_almost_equal
   raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: 3.141592653589793

======================================================================
FAIL: test_zero_pzero (test_umath.TestArctan2SpecialValues)
----------------------------------------------------------------------
Traceback (most recent call last):
 File &quot;/home/demo/master/lib/python2.7/site-packages/numpy/core/tests/test_umath.py&quot;,
line 328, in test_zero_pzero
   assert_arctan2_isnzero(np.NZERO, np.PZERO)
 File &quot;/home/demo/master/lib/python2.7/site-packages/numpy/core/tests/test_umath.py&quot;,
line 310, in assert_arctan2_isnzero
   assert (ncu.arctan2(x, y) == 0 and np.signbit(ncu.arctan2(x, y))),
&quot;arctan(%s, %s) is %s, not -0&quot; % (x, y, ncu.arctan2(x, y))
AssertionError: arctan(-0.0, 0.0) is 0.0, not -0"><pre class="notranslate"><code class="notranslate">======================================================================
FAIL: test_zero_nzero (test_umath.TestArctan2SpecialValues)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/home/demo/master/lib/python2.7/site-packages/numpy/core/tests/test_umath.py",
line 322, in test_zero_nzero
   assert_almost_equal(ncu.arctan2(np.PZERO, np.NZERO), np.pi)
 File "/home/demo/master/lib/python2.7/site-packages/numpy/testing/utils.py",
line 468, in assert_almost_equal
   raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 7 decimals
 ACTUAL: 0.0
 DESIRED: 3.141592653589793

======================================================================
FAIL: test_zero_pzero (test_umath.TestArctan2SpecialValues)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/home/demo/master/lib/python2.7/site-packages/numpy/core/tests/test_umath.py",
line 328, in test_zero_pzero
   assert_arctan2_isnzero(np.NZERO, np.PZERO)
 File "/home/demo/master/lib/python2.7/site-packages/numpy/core/tests/test_umath.py",
line 310, in assert_arctan2_isnzero
   assert (ncu.arctan2(x, y) == 0 and np.signbit(ncu.arctan2(x, y))),
"arctan(%s, %s) is %s, not -0" % (x, y, ncu.arctan2(x, y))
AssertionError: arctan(-0.0, 0.0) is 0.0, not -0
</code></pre></div>