public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
@ 2002-11-07 22:06 Tim Prince
  0 siblings, 0 replies; 2+ messages in thread
From: Tim Prince @ 2002-11-07 22:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8484; it has been noted by GNATS.

From: Tim Prince <tprince@computer.org>
To: kabal@ECE.McGill.CA, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
Date: Thu, 7 Nov 2002 22:04:24 -0800

 On Wednesday 06 November 2002 13:01, kabal@ECE.McGill.CA wrote:
 > >Number:         8484
 > >Category:       other
 > >Synopsis:       gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
 
 > >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.
 >
 
 > #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;
 > }
 I find it difficult to believe that the gcc version you use is 
 directly responsible for the behavior of newlib printf(), if that's what you 
 are claiming.  gcc-3.3 with an old glibc on linux is giving me your expected 
 result; gcc-3.3 on cygwin with the standard newlib is behaving as you report. 
 Neither glibc nor newlib is under the influence of gcc maintainers.  I doubt 
 you will find a gcc maintainer willing to install the various gcc versions on 
 cygwin, to see if they do in fact alter the behavior of newlib, nor do I see 
 what you expect gcc to do about newlib.
 -- 
 Tim Prince


^ permalink raw reply	[flat|nested] 2+ messages in thread

* other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
@ 2002-11-06 13:06 kabal
  0 siblings, 0 replies; 2+ messages in thread
From: kabal @ 2002-11-06 13:06 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-11-08  6:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-07 22:06 other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf Tim Prince
  -- strict thread matches above, loose matches on Subject: below --
2002-11-06 13:06 kabal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).