summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Haldane <ealloc@gmail.com>2018-03-26 00:52:16 (GMT)
committerGitHub <noreply@github.com>2018-03-26 00:52:16 (GMT)
commiteca4175abcdff3fc506992c74fbab67aeb48153e (patch)
treec34c8d4ad17ac5244da259ac7be09f7719f5fee3
parente4d678a2f5859d29a853d617e9e5bbd4b6241898 (diff)
parent6480ccb32bd4eed7fd43cb604fd683c84966327a (diff)
downloadpython-numpy-eca4175abcdff3fc506992c74fbab67aeb48153e.zip
python-numpy-eca4175abcdff3fc506992c74fbab67aeb48153e.tar.gz
python-numpy-eca4175abcdff3fc506992c74fbab67aeb48153e.tar.bz2
Merge pull request #10774 from mdboom/fix-sqrt-min-for-no-long-double
BUG: 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);