bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Broken isnan(3) and/or DQNAN on Tru64


From: Bruno Haible
Subject: Re: Broken isnan(3) and/or DQNAN on Tru64
Date: Fri, 1 May 2009 18:11:31 +0200
User-agent: KMail/1.9.9

Ludovic Courtès wrote:
> On `alphaev56-dec-osf5.1b', NaN handling seems to be deeply broken.
> Consider this piece of code:
> 
> --8<---------------cut here---------------start------------->8---
> #include <math.h>
> 
> extern unsigned int DQNAN[2];
> 
> int
> main (int argc, char *argv[])
> {
>   return isnan (* (double *) DQNAN);
> }
> --8<---------------cut here---------------end--------------->8---
> 
> When compiled with GCC 4.0.2, it bails out with SIGFPE.

What's the result when you compile it with cc?
  $ cc foo.c -lm
  $ ./a.out
  $ echo $?

What's the result for a program that uses a quiet NaN, computed
differently?

  #include <math.h>
  double zero = 0.0;
  int main()
  {
    return isnan (zero / zero);
  };

And finally, what's the hexdump of that DQNAN constant?

  #include <math.h>
  #include <stdio.h>
  int main()
  {
    printf("%04X%04X\n", DQNAN[1], DQNAN[0]);
    return 0;
  }

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]