Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* How do I generate a NaN value at compile time?
@ 2001-04-16 15:10 Douglas Carmichael
  2001-04-23  1:01 ` Mark Garrett
  0 siblings, 1 reply; 2+ messages in thread
From: Douglas Carmichael @ 2001-04-16 15:10 UTC (permalink / raw)



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?

Please reply by email to dcarmich@ourservers.net.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How do I generate a NaN value at compile time?
  2001-04-16 15:10 How do I generate a NaN value at compile time? Douglas Carmichael
@ 2001-04-23  1:01 ` Mark Garrett
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Garrett @ 2001-04-23  1:01 UTC (permalink / raw)


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 :)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-23  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox