public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Tim Prince <tprince@computer.org>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: other/8484: gcc 3.2: log(0) => NaN ; -(Inf) => NaN; should return -Inf
Date: Thu, 07 Nov 2002 22:06:00 -0000	[thread overview]
Message-ID: <20021108060601.9662.qmail@sources.redhat.com> (raw)

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


             reply	other threads:[~2002-11-08  6:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-07 22:06 Tim Prince [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-06 13:06 kabal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021108060601.9662.qmail@sources.redhat.com \
    --to=tprince@computer.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).