Commit adb82430bfd1baa654a559891db27930a130073d
1 parent
7fced8be
Exists in
SpeasyGet
Fix fillValue comparison
Showing
1 changed file
with
15 additions
and
6 deletions
Show diff stats
src/ParamGetImpl/SpeasyProxyInterface/Pusher.hh
@@ -176,9 +176,12 @@ public: | @@ -176,9 +176,12 @@ public: | ||
176 | //get data element | 176 | //get data element |
177 | if (packet->getDataValue(&baseElem,index,dim1Index,dim2Index)) | 177 | if (packet->getDataValue(&baseElem,index,dim1Index,dim2Index)) |
178 | { | 178 | { |
179 | - if (!isnan(_fillValue)) | ||
180 | - if (baseElem == fillEl) | 179 | + if (!isnan(_fillValue)) { |
180 | + double crt_val = baseElem; | ||
181 | + bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); | ||
182 | + if (is_fill_value) | ||
181 | baseElem << NotANumber(); | 183 | baseElem << NotANumber(); |
184 | + } | ||
182 | } | 185 | } |
183 | else | 186 | else |
184 | baseElem << NotANumber(); | 187 | baseElem << NotANumber(); |
@@ -264,9 +267,13 @@ public: | @@ -264,9 +267,13 @@ public: | ||
264 | //get data element | 267 | //get data element |
265 | if (packet->getDataValue(&baseElem,index,dimIndex)) | 268 | if (packet->getDataValue(&baseElem,index,dimIndex)) |
266 | { | 269 | { |
267 | - if (!isnan(_fillValue)) | ||
268 | - if (baseElem == fillEl) | ||
269 | - baseElem << NotANumber(); | 270 | + if (!isnan(_fillValue)) { |
271 | + double crt_val = baseElem; | ||
272 | + bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); | ||
273 | + if (is_fill_value) | ||
274 | + baseElem << NotANumber(); | ||
275 | + } | ||
276 | + | ||
270 | } | 277 | } |
271 | else | 278 | else |
272 | baseElem << NotANumber(); | 279 | baseElem << NotANumber(); |
@@ -345,7 +352,9 @@ public: | @@ -345,7 +352,9 @@ public: | ||
345 | { | 352 | { |
346 | if (!isnan(_fillValue)) | 353 | if (!isnan(_fillValue)) |
347 | { | 354 | { |
348 | - if (baseElem == fillEl) | 355 | + double crt_val = baseElem; |
356 | + bool is_fill_value = isApproximatelyEqual(crt_val, _fillValue); | ||
357 | + if (is_fill_value) | ||
349 | baseElem << NotANumber(); | 358 | baseElem << NotANumber(); |
350 | } | 359 | } |
351 | } | 360 | } |