|
1 | 1 | #include <functional> |
2 | 2 | #include <limits> |
| 3 | +#include <cmath> |
| 4 | + |
3 | 5 | #include <math.h> |
4 | 6 |
|
5 | 7 | #include "_transforms.h" |
6 | 8 | #include "mplutils.h" |
7 | | -#include "MPL_isnan.h" |
8 | 9 |
|
9 | 10 | #include "numpy/arrayobject.h" |
10 | 11 |
|
@@ -472,7 +473,7 @@ Bbox::update(const Py::Tuple &args) { |
472 | 473 | tup = xys[i]; |
473 | 474 | double x = Py::Float(tup[0]); |
474 | 475 | double y = Py::Float(tup[1]); |
475 | | - if (MPL_isnan64(x) || MPL_isnan64(y)) continue; |
| 476 | + if (std::isnan(x) || std::isnan(y)) continue; |
476 | 477 | _posx.update(x); |
477 | 478 | _posy.update(y); |
478 | 479 | if (x<minx) minx=x; |
@@ -537,7 +538,7 @@ Bbox::update_numerix_xy(const Py::Tuple &args) { |
537 | 538 | for (size_t i=0; i< Nxy; ++i) { |
538 | 539 | thisx = *(double *)(xyin->data + i*xyin->strides[0]); |
539 | 540 | thisy = *(double *)(xyin->data + i*xyin->strides[0] + xyin->strides[1]); |
540 | | - if (MPL_isnan64(thisx) || MPL_isnan64(thisy)) continue; |
| 541 | + if (std::isnan(thisx) || std::isnan(thisy)) continue; |
541 | 542 | _posx.update(thisx); |
542 | 543 | _posy.update(thisy); |
543 | 544 | if (thisx<minx) minx=thisx; |
@@ -611,7 +612,7 @@ Bbox::update_numerix(const Py::Tuple &args) { |
611 | 612 | for (size_t i=0; i< Nx; ++i) { |
612 | 613 | thisx = *(double *)(x->data + i*x->strides[0]); |
613 | 614 | thisy = *(double *)(y->data + i*y->strides[0]); |
614 | | - if (MPL_isnan64(thisx) || MPL_isnan64(thisy)) continue; |
| 615 | + if (std::isnan(thisx) || std::isnan(thisy)) continue; |
615 | 616 | _posx.update(thisx); |
616 | 617 | _posy.update(thisy); |
617 | 618 | if (thisx<minx) minx=thisx; |
@@ -1253,12 +1254,12 @@ Transformation::nonlinear_only_numerix(const Py::Tuple & args, const Py::Dict &k |
1253 | 1254 |
|
1254 | 1255 | double thisx = *(double *)(x->data + i*x->strides[0]); |
1255 | 1256 | double thisy = *(double *)(y->data + i*y->strides[0]); |
1256 | | - if (MPL_isnan64(thisx) || MPL_isnan64(thisy)) { |
| 1257 | + if (std::isnan(thisx) || std::isnan(thisy)) { |
1257 | 1258 | if (returnMask) { |
1258 | 1259 | *(unsigned char *)(retmask->data + i*retmask->strides[0]) = 0; |
1259 | 1260 | } |
1260 | 1261 | double MPLnan; // don't require C99 math features - find our own nan |
1261 | | - if (MPL_isnan64(thisx)) { |
| 1262 | + if (std::isnan(thisx)) { |
1262 | 1263 | MPLnan=thisx; |
1263 | 1264 | } else { |
1264 | 1265 | MPLnan=thisy; |
|
0 commit comments