This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Organization: RSMAS Hi Angel, > I have been working with a graphics package, GMT, that likes to use > NaN's. What happens when these "values" get XDR'ed out and back in? > Is this undefined behavior? I'm doing my playing on an Alpha running > OSF/1 if it matters and usually the first thing these programs do is > disable SIGFPE. What happens is not well-defined. On some systems, there is apparently no bit pattern that will behave like a NaN when floating-point arithmetic is used but that will also map under XDR to something that will still behave like a NaN when un-XDRed. We had assumed there was always such a bit pattern and we had tried to use it consistently on each platform for the netCDF fill-value for floats, but we discovered our assumption was wrong. The official XDR RFC 1014 says: According to IEEE specifications, the "NaN" (not a number) is system dependent and should not be used externally. --Russ