Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion numpy/core/src/npymath/npy_math.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,11 @@ double npy_log2(double x)
#ifndef HAVE_CBRT@C@
@type@ npy_cbrt@c@(@type@ x)
{
if (x < 0) {
/* don't set invalid flag */
if (npy_isnan(x)) {
return NPY_NAN;
}
else if (x < 0) {
return -npy_pow@c@(-x, 1. / 3.);
}
else {
Expand Down
10 changes: 0 additions & 10 deletions numpy/core/src/private/npy_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
*/
#define NPY_MAX_COPY_ALIGNMENT 16

/* Safe to use ldexp and frexp for long double for MSVC builds */
#if (NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE) || defined(_MSC_VER)
#ifdef HAVE_LDEXP
#define HAVE_LDEXPL 1
#endif
#ifdef HAVE_FREXP
#define HAVE_FREXPL 1
#endif
#endif

/* Disable broken Sun Workshop Pro math functions */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one, the same code is in v1.8.2. What is the motivation? I'm sure there is a reason...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think its necessary. The motivation was, AFAICT, that since frexp and ldexp were wrapped by hand the logic for using the double versions for long double also needed to be by hand. In npy_math we just wrap these like any other now, meaning that we always call the double version for long double if we don't have an explicit l version, so this logic shouldn't be necessary.

#ifdef __SUNPRO_C
#undef HAVE_ATAN2
Expand Down