Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

NAN as _FillValue/missing_value

I went to convert my _FillValue to NAN; I found that upon reading data and doing comparisons a false is always returned:

  if (datum[i] == vp->attr->missingValue)  // is always false if nan's

At 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

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690