diff options
-rw-r--r-- | numpy/core/src/npymath/npy_math_complex.c.src | 4 |
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 ea784ec5b..cf427dad8 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); |