There are a set of three unit test failures on Solaris all related to differences in the atan2 implementation, reported as bugs 1201, 1202 and 1203.

They boil down to the following three differences between Solaris (C compiler 5.3) and "other" platforms -- when I say "other" I mean at least Linux x86 and x86_64, and Mac OS X x86.

import numpy as np
import numpy.core.umath as ncu

ncu.arctan2(np.PZERO, np.NZERO)
0.0 (Solaris) 3.1415926535897931 (other)

ncu.arctan2(np.NZERO, np.NZERO)
0.0 (Solaris) -3.1415926535897931 (other)

np.signbit(ncu.arctan2(np.NZERO, np.PZERO))
False (Solaris) True (other)


The easy fix seems to be to force it to use the npy_math version of atan2 on Solaris (as we already do for MS Windows). (Patch attached). Indeed this fixes the unit tests. Does that seem right?

Mike

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA



Index: numpy/core/src/private/npy_config.h
===================================================================
--- numpy/core/src/private/npy_config.h (revision 7726)
+++ numpy/core/src/private/npy_config.h (working copy)
@@ -9,4 +9,9 @@
 #undef HAVE_HYPOT
 #endif

+/* Disable broken Solaris math functions */
+#ifdef __SUNPRO_C
+#undef HAVE_ATAN2
 #endif
+
+#endif
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to