public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: ak@ixion.net
To: gcc-gnats@gcc.gnu.org
Subject: c++/3475: fabs == identity (i.e. fabs broken)
Date: Fri, 29 Jun 2001 03:46:00 -0000	[thread overview]
Message-ID: <20010629104533.547.qmail@ixion.net> (raw)

>Number:         3475
>Category:       c++
>Synopsis:       fabs == identity (i.e. fabs broken)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 29 03:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     ak@ixion.net
>Release:        3.0
>Organization:
iXiONmedia
>Environment:
System: Linux dendrite 2.4.4 #4 Don Mai 3 00:14:41 CEST 2001 i586 unknown
Architecture: i586

host: i586-pc-linux-gnu
build: i586-pc-linux-gnu
target: i586-pc-linux-gnu
configured with: ./configure --prefix=/opt/gcc-3.0/
>Description:
fabs.c ------------------------------------------------------------------------

#include <math.h>
#include <stdio.h>

int main() {
  double u = -5;
  printf("%lf\n",fabs(u));
  }
-------------------------------------------------------------------------------


compiling this program results (correctly) in "5.0000" when compiled with

gcc fabs.c -o fabs

and (incorrectly) in "-5.00000" when compiled with

g++ fabs.c -o fabs

>How-To-Repeat:
>Fix:
	write your own code for fabs
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-06-29  3:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-29  3:46 ak [this message]
2001-08-12  3:33 gdr

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=20010629104533.547.qmail@ixion.net \
    --to=ak@ixion.net \
    --cc=gcc-gnats@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).