Skip to content

Commit

Permalink
Per dtcenter/METplus#2920 discussion (incl with issue #3095), update …
Browse files Browse the repository at this point in the history
…the is_eq(a,b) logic to return true if both values are NaN.
  • Loading branch information
JohnHalleyGotway committed Mar 8, 2025
1 parent ee941ed commit 5e08fcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/basic/vx_math/is_bad_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ inline int is_bad_data(char a) {
}

inline int is_eq(double a, double b, double tol) {
if(fabs(a - b) < tol) return 1;
if((is_bad_data(a) && is_bad_data(b)) ||
fabs(a - b) < tol) return 1;
else return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/core/point_stat/point_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ void process_obs_file(int i_nc) {

const int buf_size = (obs_count > BUFFER_SIZE) ? BUFFER_SIZE : obs_count;
vector<int> obs_qty_idx_block(buf_size);
vector<std::array<float, OBS_ARRAY_LEN>> obs_arr_block(buf_size);
vector<std::array<float, OBS_ARRAY_LEN>> obs_arr_block(buf_size);

// Process each observation in the file
int block_size;
Expand Down

0 comments on commit 5e08fcc

Please sign in to comment.