File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Original file line number Diff line number Diff line change @@ -1195,9 +1195,11 @@ struct _is_sorted
1195
1195
1196
1196
size = PyArray_DIM (array, 0 );
1197
1197
1198
+ // std::isnan is only in C++11, which we don't yet require,
1199
+ // so we use the the "self == self" trick
1198
1200
for (i = 0 ; i < size; ++i) {
1199
1201
last_value = *((T *)PyArray_GETPTR1 (array, i));
1200
- if (std::isfinite ( last_value) ) {
1202
+ if (last_value == last_value ) {
1201
1203
break ;
1202
1204
}
1203
1205
}
@@ -1209,7 +1211,7 @@ struct _is_sorted
1209
1211
1210
1212
for (; i < size; ++i) {
1211
1213
current_value = *((T *)PyArray_GETPTR1 (array, i));
1212
- if (std::isfinite ( current_value) ) {
1214
+ if (current_value == current_value ) {
1213
1215
if (current_value < last_value) {
1214
1216
return false ;
1215
1217
}
You can’t perform that action at this time.
0 commit comments