From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,b0f7f17e372ff3b1 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-04-22 18:01:05 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mail From: Mark Garrett Newsgroups: comp.unix.tru64 Subject: Re: How do I generate a NaN value at compile time? Organization: Garetech Computer Solutions Message-ID: References: <9bf21c$5rc$1@flood.xnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Mon, 23 Apr 2001 01:01:04 GMT NNTP-Posting-Host: 144.132.244.163 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 987987664 144.132.244.163 (Mon, 23 Apr 2001 11:01:04 EST) NNTP-Posting-Date: Mon, 23 Apr 2001 11:01:04 EST Xref: newsfeed.google.com comp.unix.tru64:2108 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 :)