- To: netcdfgroup@xxxxxxxxxxxxxxxx
- Subject: NAN as _FillValue/missing_value
- From: Chris Webster <cjw@xxxxxxxx>
- Date: Sun, 16 Jan 2005 08:56:09 -0700
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'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
- Follow-Ups:
- Re: NAN as _FillValue/missing_value
- From: Philippe Poilbarbe
- Re: NAN as _FillValue/missing_value
- From: Mark Hadfield
- Re: NAN as _FillValue/missing_value