Skip to content

Commit e783f08

Browse files
authored
chore(core): use std::isnan (#6209)
1 parent bbfeecc commit e783f08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/c/share/vec_agg_vanilla.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ int64_t countDouble_Vanilla(double *d, int64_t count) {
9999
int64_t cnt = 0;
100100
for (; d < lim; d++) {
101101
const double v = *d;
102-
if (v == v) {
102+
if (!std::isnan(v)) {
103103
cnt += 1;
104104
}
105105
}
@@ -115,7 +115,7 @@ double sumDouble_Vanilla(double *d, int64_t count) {
115115
bool hasData = false;
116116
for (; d < lim; d++) {
117117
const double v = *d;
118-
if (v == v) {
118+
if (!std::isnan(v)) {
119119
sum += v;
120120
hasData = true;
121121
}
@@ -350,7 +350,7 @@ Java_io_questdb_std_Vect_avgDoubleAcc(JNIEnv *env, jclass cl, jlong pi, jlong co
350350
double_t c = 1;
351351
for (uint32_t i = 0; i < count; i++) {
352352
double_t v = ppi[i];
353-
if (v == v) {
353+
if (!std::isnan(v)) {
354354
avg += (v - avg) / c;
355355
++c;
356356
}

0 commit comments

Comments
 (0)