summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/common/npy_config.h16
-rw-r--r--numpy/core/tests/test_scalarmath.py15
2 files changed, 31 insertions, 0 deletions
diff --git a/numpy/core/src/common/npy_config.h b/numpy/core/src/common/npy_config.h
index a985c8274..b01eca5ab 100644
--- a/numpy/core/src/common/npy_config.h
+++ b/numpy/core/src/common/npy_config.h
@@ -135,6 +135,22 @@
/* np.power(..., dtype=np.complex256) doesn't report overflow */
#undef HAVE_CPOWL
#undef HAVE_CEXPL
+
+#include <cygwin/version.h>
+#if CYGWIN_VERSION_DLL_MAJOR < 3003
+/* https://cygwin.com/pipermail/cygwin-announce/2021-October/010268.html */
+/* Builtin abs reports overflow */
+#undef HAVE_CABSL
+#undef HAVE_HYPOTL
+#endif
+
+#if CYGWIN_VERSION_DLL_MAJOR < 3002
+/* https://cygwin.com/pipermail/cygwin-announce/2021-March/009987.html */
+/* Segfault */
+#undef HAVE_MODFL
+/* sqrt(-inf) returns -inf instead of -nan */
+#undef HAVE_SQRTL
+#endif
#endif
/* Disable broken gnu trig functions */
diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py
index 2311a04f7..eedba0d5e 100644
--- a/numpy/core/tests/test_scalarmath.py
+++ b/numpy/core/tests/test_scalarmath.py
@@ -4,6 +4,7 @@ import warnings
import itertools
import operator
import platform
+from distutils.version import LooseVersion as _LooseVersion
import pytest
from hypothesis import given, settings, Verbosity
from hypothesis.strategies import sampled_from
@@ -680,10 +681,24 @@ class TestAbs:
@pytest.mark.parametrize("dtype", floating_types + complex_floating_types)
def test_builtin_abs(self, dtype):
+ if (
+ sys.platform == "cygwin" and dtype == np.clongdouble and
+ _LooseVersion(platform.release().split("-")[0]) < _LooseVersion("3.3.0")
+ ):
+ pytest.xfail(
+ reason="absl is computed in double precision on cygwin < 3.3"
+ )
self._test_abs_func(abs, dtype)
@pytest.mark.parametrize("dtype", floating_types + complex_floating_types)
def test_numpy_abs(self, dtype):
+ if (
+ sys.platform == "cygwin" and dtype == np.clongdouble and
+ _LooseVersion(platform.release().split("-")[0]) < _LooseVersion("3.3.0")
+ ):
+ pytest.xfail(
+ reason="absl is computed in double precision on cygwin < 3.3"
+ )
self._test_abs_func(np.abs, dtype)
class TestBitShifts: