NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
if (datum[i] == vp->attr->missingValue) // is always false if nan'sAt first I thought I was back in the world of round off hell until I was pointed to:
http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm specifically these lines: "A NAN will never return true on a <= comparison," and"One other complication is that comparisons involving NANs are always supposed to return false, "
I would like to suggest that mention of this be made on the netCDF Best Practices page where you point people to use NAN as the _FillValue.
...then I'd like to whine that I have to retro-fit all my code and double the number of checks for every data point to determine if it's _Fill/missing (...using isnan(3)). :)
--Chris
netcdfgroup
archives: