On Sun, Jul 02, 2000 at 05:22:53PM +0200, Peter Eisentraut wrote:
> pgsql-hackers@thewrittenword.com writes:
>
> > 3. Why is NAN defined in src/include/solaris_i386.h as:
> > #define NAN (*(__const double *) __nan)
> > #endif /* GCC. */
> > if the compiler is not GCC? The Solaris C compiler does not like this.
> > I removed it and the compilation succeeded.
>
> We never cleared out this item. What is the proper way to generate a `NaN'
> on your compiler? Does `0.0/0.0' work?
I tried the following:
#include <ieeefp.h>
#include <stdio.h>
int
main (void) { float f = 0.0/0.0;
if (isnanf (f)) { puts ("nan"); }
}
and the output was "nan".
--
albert chin (china@thewrittenword.com)