summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2018-03-21 01:51:50 (GMT)
committerMichael Droettboom <mdboom@gmail.com>2018-03-21 01:51:50 (GMT)
commit6480ccb32bd4eed7fd43cb604fd683c84966327a (patch)
tree37905764d5a57074a165d246a8749287484afd8e
parent517f4c0749f83488d25493ccea62b91caa03c2d6 (diff)
downloadpython-numpy-6480ccb32bd4eed7fd43cb604fd683c84966327a.zip
python-numpy-6480ccb32bd4eed7fd43cb604fd683c84966327a.tar.gz
python-numpy-6480ccb32bd4eed7fd43cb604fd683c84966327a.tar.bz2
Fix SQRT_MIN for platforms with 8-byte long double
-rw-r--r--numpy/core/src/npymath/npy_math_complex.c.src4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/npymath/npy_math_complex.c.src b/numpy/core/src/npymath/npy_math_complex.c.src
index ea784ec..cf427da 100644
--- a/numpy/core/src/npymath/npy_math_complex.c.src
+++ b/numpy/core/src/npymath/npy_math_complex.c.src
@@ -1526,9 +1526,13 @@ const npy_float SQRT_MIN = 1.0842022e-19f;
const npy_double SQRT_MIN = 1.4916681462400413e-154; /* sqrt(DBL_MIN) */
#endif
#if @precision@ == 3
+#if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
+const npy_longdouble SQRT_MIN = 1.4916681462400413e-154; /* sqrt(DBL_MIN) */
+#else
/* this is correct for 80 bit long doubles */
const npy_longdouble SQRT_MIN = 1.8336038675548471656e-2466l;
#endif
+#endif
/* Avoid underflow when y is small. */
if (y < SQRT_MIN) {
return (x * x);