8000 TST: Add cygwin build to CI by DWesl · Pull Request #18330 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: Add cygwin build to CI #18330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 21, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
BUG: Set default hypotl to use npy_longdouble arithmetic.
The implementation is already there, and the tests require
npy_longdouble arithmetic, so I set up the boilerplate to make it so.

It seems to fix only np.abs(npy_clongdouble), not
abs(npy_clongdouble), for reasons I don't understand.
  • Loading branch information
DWesl committed Jul 20, 2021
commit aa9fd3c7cb7c535355996c591b210beeec71a700
27 changes: 17 additions & 10 deletions numpy/core/src/npymath/npy_math_internal.h.src
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ NPY_INPLACE double npy_atan2(double y, double x)

#endif

#ifndef HAVE_HYPOT
NPY_INPLACE double npy_hypot(double x, double y)
/**begin repeat
* #type = npy_float, npy_double, npy_longdouble#
* #c = f, , l#
* #C = F, , L#
*/
#ifndef HAVE_HYPOT@C@
NPY_INPLACE @type@ npy_hypot@c@(@type@ x, @type@ y)
{
double yx;
@type@ yx;

if (npy_isinf(x) || npy_isinf(y)) {
return NPY_INFINITY;
Expand All @@ -201,10 +206,11 @@ NPY_INPLACE double npy_hypot(double x, double y)
return NPY_NAN;
}

x = npy_fabs(x);
y = npy_fabs(y);
x = npy_fabs@c@(x);
y = npy_fabs@c@(y);
/* Ensure |x| >= |y|, switching if needed */
if (x < y) {
double temp = x;
@type@ temp = x;
x = y;
y = temp;
}
Expand All @@ -213,10 +219,11 @@ NPY_INPLACE double npy_hypot(double x, double y)
}
else {
yx = y/x;
return x*npy_sqrt(1.+yx*yx);
return x*npy_sqrt@c@(1.+yx*yx);
}
}
#endif
/**end repeat**/

#ifndef HAVE_ACOSH
NPY_INPLACE double npy_acosh(double x)
Expand Down Expand Up @@ -361,7 +368,7 @@ NPY_INPLACE double npy_log2(double x)
* asin, acos, atan,
* asinh, acosh, atanh
*
* hypot, atan2, pow, fmod, modf
* atan2, pow, fmod, modf
* ldexp, frexp
*
* We assume the above are always available in their double versions.
Expand Down Expand Up @@ -398,8 +405,8 @@ NPY_INPLACE @type@ npy_@kind@@c@(@type@ x)
/**end repeat1**/

/**begin repeat1
* #kind = atan2,hypot,pow,fmod,copysign#
* #KIND = ATAN2,HYPOT,POW,FMOD,COPYSIGN#
* #kind = atan2,pow,fmod,copysign#
* #KIND = ATAN2,POW,FMOD,COPYSIGN#
*/
#ifdef @kind@@c@
#undef @kind@@c@
Expand Down
0