This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
- From: kabal at ECE dot McGill dot CA
- To: gcc-gnats at gcc dot gnu dot org
- Date: 6 Nov 2002 21:01:00 -0000
- Subject: other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
- Reply-to: kabal at ECE dot McGill dot CA
>Number: 8484
>Category: other
>Synopsis: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 06 13:06:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Peter Kabal
>Release: gcc version 3.2 20020818 (prerelease)
>Organization:
>Environment:
Cygwin under Windows XP pro
>Description:
Tests show that log(0) returns NaN and negating Inf also gives NaN. Under previous 2.9x versions of gcc, these would both return -Inf.
>How-To-Repeat:
gcc tInf.c -o tInf.exe
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="tInf.c"
Content-Disposition: inline; filename="tInf.c"
#include <math.h>
int main (int argc, const char *argv[])
{
double dv;
dv = -sqrt(1.0) / 0.0;
printf ("-sqrt(1) = %g\n", dv);
dv = log (0.0);
printf ("log(0) = %g\n", dv);
return 0;
}