This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: assignment problem with doubles: getting -NaN unexpectedly
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: assignment problem with doubles: getting -NaN unexpectedly
- From: Bill Gribble <grib at cs dot utexas dot edu>
- Date: 12 Oct 1999 09:21:06 -0500
> I have a problem with an assigment of one double variable to
> another, like dub1 = dub2; I'm getting -NaN in dub1, even if there
> is a valid value in dub2. This is on RedHat Linux 6.0, kernel
> 2.2.5, glibc-2.1.1-6 C compiler is egcs-2.91.66 19990314/Linux
> (egcs-1.1.2 release)
I'm not a subscriber to the gcc-bugs list but I ran across this on the
mailing list archive; it was posted last Friday.
This problem has hit me, too, with gcc-2.95.2 and very recent libc and
linux kernel. With -O3, simple double math (no division) results in
NaN sporadically, but inserting debugging print statements seems to
make this not happen.
Any workarounds or theories?
Thanks,
Bill Gribble