summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-05-04 13:08:48 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2022-06-13 09:36:57 -0700
commit219697afb8bc0dfe3b0332a9a6bf3efd8a558e45 (patch)
tree48cac4f85dee712834ceae8ce7bb9e2f41e5c829 /numpy
parentfc865d8c6212b51bb03190f2cd732f1d484539dd (diff)
downloadnumpy-219697afb8bc0dfe3b0332a9a6bf3efd8a558e45.tar.gz
TST: Fixup test name and check for ppc64le
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_casting_floatingpoint_errors.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/core/tests/test_casting_floatingpoint_errors.py b/numpy/core/tests/test_casting_floatingpoint_errors.py
index 70a59a72b..669a0d174 100644
--- a/numpy/core/tests/test_casting_floatingpoint_errors.py
+++ b/numpy/core/tests/test_casting_floatingpoint_errors.py
@@ -26,9 +26,13 @@ def values_and_dtypes():
yield param(np.longdouble(1e300), "float32", id="longdouble-to-f2")
yield param(np.float64(1e300), "float32", id="double-to-f2")
# Casting to float64:
- if np.finfo(np.longdouble).max > np.finfo(np.float64).max:
+ # If longdouble is double-double, its max can be rounded down to the double
+ # max. So we correct the double spacing (a bit weird, admittedly):
+ max_ld = np.finfo(np.longdouble).max
+ spacing = np.spacing(np.nextafter(np.finfo("f8").max, 0))
+ if max_ld - spacing > np.finfo("f8").max:
yield param(np.finfo(np.longdouble).max, "float64",
- id="longdouble-to-f4")
+ id="longdouble-to-f8")
# Invalid float to integer casts:
with np.errstate(over="ignore"):