This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf


>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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]