From: Mark Garrett <Mark.Garrett@wedontwantyourspam.com.au>
Subject: Re: How do I generate a NaN value at compile time?
Date: Mon, 23 Apr 2001 01:01:04 GMT [thread overview]
Message-ID: <B709BAE4.16FB3%Mark.Garrett@wedontwantyourspam.com.au> (raw)
In-Reply-To: 9bf21c$5rc$1@flood.xnet.com
in article 9bf21c$5rc$1@flood.xnet.com, Douglas Carmichael at
dcarmich@ourservers.net wrote on 17/04/2001 01:10:
>
> I'm trying to compile PostgreSQL v7.1 on Tru64 v5.0A/rev 1094 with Compaq
> C T6.4-212 (dtk), and the compiler is complaining about not being able to
> generate a NaN value at compile time:
> cc -std -O4 -Olimit 2000 -I../../../../src/include -c -o float.o float.c
> cc: Error: float.c, line 251: In this statement, the libraries on this
> platform do not yet support compile-time evaluation of the constant
> expression "0.0/0.0". (constfoldns)
> val = NAN;
> ------------------------------^
>
> However, the code needs a NaN value. How do I generate a NaN value at
> compile time?
Its only a warning, you could use DBL_QNAN
#define NAN DBL_QNAN
#ifndef NAN
#define NAN (0.0/0.0)
#endif
Cheers
mark :)
prev parent reply other threads:[~2001-04-23 1:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-16 15:10 How do I generate a NaN value at compile time? Douglas Carmichael
2001-04-23 1:01 ` Mark Garrett [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox