Hello,

Bruno Haible <br...@clisp.org> writes:

> I meant %08X instead of %04X. DQNAN therefore likely is
>   FFF8000000000000
> which decomposes into
>   sign = 1 (irrelevant for NaNs),
>   exponent = 0x7FF (highest possible value)
>   mantissa = 0x8000000000000
> and this is precisely the common encoding of a quiet NaN
> (see <http://en.wikipedia.org/wiki/Not_a_number>).

Right.

>> > What's the result when you compile it with cc?
>> >   $ cc foo.c -lm
>> >   $ ./a.out
>> >   $ echo $?
>> 
>> 1
>> 
>> That's with "Compaq C V6.5-303 (dtk) on Compaq Tru64 UNIX V5.1B
>> (Rev. 2650)".
>> 
>> Should we conclude that this is a GCC bug?
>
> Possibly. And what result do you get with "gcc -mieee" ?

It works (returns 1).

The GCC manual (info "(gcc) DEC Alpha Options") reads this:

`-mieee'

     [...]
     This option generates code fully IEEE compliant code [...]

     The resulting code is less efficient but is able to correctly
     support denormalized numbers and exceptional IEEE values such as
     not-a-number and plus/minus infinity.

So people compiling with GCC on this platform should pass `-mieee'
(`configure' could add it automatically.)

Thanks for your help!

Ludo'.


Reply via email to