Skip to content

Commit

Permalink
#1580 Correct the precision at _apply_scale_factor
Browse files Browse the repository at this point in the history
  • Loading branch information
hsoh-u committed Jan 14, 2021
1 parent 412cfcd commit 148588d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions met/src/libcode/vx_nc_util/nc_utils.cc
Expand Up @@ -1404,7 +1404,7 @@ void _apply_scale_factor(float *data, const T *packed_data,
else {
if (raw_min_val > packed_data[idx]) raw_min_val = packed_data[idx];
if (raw_max_val < packed_data[idx]) raw_max_val = packed_data[idx];
data[idx] = (packed_data[idx] * scale_factor) + add_offset;
data[idx] = ((float)packed_data[idx] * scale_factor) + add_offset;
if (data[idx] > 0) positive_cnt++;
if (min_value > data[idx]) min_value = data[idx];
if (max_value < data[idx]) max_value = data[idx];
Expand Down Expand Up @@ -1680,7 +1680,7 @@ int _apply_scale_factor(double *data, const T *packed_data,
else {
if (raw_min_val > packed_data[idx]) raw_min_val = packed_data[idx];
if (raw_max_val < packed_data[idx]) raw_max_val = packed_data[idx];
data[idx] = (packed_data[idx] * scale_factor) + add_offset;
data[idx] = ((double)packed_data[idx] * scale_factor) + add_offset;
if (data[idx] > 0) positive_cnt++;
if (min_value > data[idx]) min_value = data[idx];
if (max_value < data[idx]) max_value = data[idx];
Expand Down

0 comments on commit 148588d

Please sign in to comment.