diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/npymath/npy_math_internal.h.src | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/core/src/npymath/npy_math_internal.h.src b/numpy/core/src/npymath/npy_math_internal.h.src index 6a0b487c7..055967951 100644 --- a/numpy/core/src/npymath/npy_math_internal.h.src +++ b/numpy/core/src/npymath/npy_math_internal.h.src @@ -98,7 +98,7 @@ NPY_INPLACE double npy_log2(double x) { #ifdef HAVE_LOG2 return log2(x); -#elif defined(HAVE_FREXP) +#else if (!npy_isfinite(x) || x <= 0.) { /* special value result */ return npy_log(x); @@ -123,9 +123,6 @@ NPY_INPLACE double npy_log2(double x) return log(m) / log(2.0) + e; } } -#else - /* does not provide int(log(2**i)) == i */ - return NPY_LOG2E * npy_log(x); #endif } |
