public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5060: Comparisons between double on gcc 2.96
@ 2001-12-11 16:46 rodrigc
0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-11 16:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/5060; it has been noted by GNATS.
From: rodrigc@gcc.gnu.org
To: chailan@sand.cad.cea.fr, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/5060: Comparisons between double on gcc 2.96
Date: 12 Dec 2001 00:36:57 -0000
Synopsis: Comparisons between double on gcc 2.96
State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Tue Dec 11 16:36:56 2001
State-Changed-Why:
Refer to "excess precision"
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5060&database=gcc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/5060: Comparisons between double on gcc 2.96
@ 2001-12-11 16:36 rodrigc
0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-11 16:36 UTC (permalink / raw)
To: chailan, gcc-bugs, gcc-gnats, gcc-prs, nobody
Synopsis: Comparisons between double on gcc 2.96
State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Tue Dec 11 16:36:56 2001
State-Changed-Why:
Refer to "excess precision"
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5060&database=gcc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/5060: Comparisons between double on gcc 2.96
@ 2001-12-10 17:06 Richard Henderson
0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2001-12-10 17:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/5060; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: rodrigc@gcc.gnu.org
Cc: chailan@sand.cad.cea.fr, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: c++/5060: Comparisons between double on gcc 2.96
Date: Mon, 10 Dec 2001 16:55:44 -0800
On Mon, Dec 10, 2001 at 07:43:54PM -0000, rodrigc@gcc.gnu.org wrote:
> double z = 1.0/i ;
> double o_x = x ;
> x = x + z ;
> printf("i:%g %20.20g %20.20g ", i, z+ o_x, x);
> double q = o_x+z;
> //if( ! (x==(double)(o_x+z))) std::cout <<"HELP!";
Seach for "excess precision" on this list. This is faq.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/5060: Comparisons between double on gcc 2.96
@ 2001-12-10 11:46 rodrigc
0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-10 11:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/5060; it has been noted by GNATS.
From: rodrigc@gcc.gnu.org
To: chailan@sand.cad.cea.fr, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/5060: Comparisons between double on gcc 2.96
Date: 10 Dec 2001 19:43:54 -0000
Synopsis: Comparisons between double on gcc 2.96
State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Mon Dec 10 11:43:54 2001
State-Changed-Why:
Reproduced with gcc 3.0 and gcc 3.1 on Linux on x86.
The problem goes away if I change your testcase to:
#include <cstddef>
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
double x = 0.0 ;
std::cout << "Testing floating point behaviour" << std::endl ;
for( double i=1 ; i<10 ; i++ )
{
double z = 1.0/i ;
double o_x = x ;
x = x + z ;
printf("i:%g %20.20g %20.20g ", i, z+ o_x, x);
double q = o_x+z;
//if( ! (x==(double)(o_x+z))) std::cout <<"HELP!";
if( ! (x==q)) std::cout <<"HELP!";
std::cout << std::endl;
}
}
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5060&database=gcc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/5060: Comparisons between double on gcc 2.96
@ 2001-12-10 11:43 rodrigc
0 siblings, 0 replies; 6+ messages in thread
From: rodrigc @ 2001-12-10 11:43 UTC (permalink / raw)
To: chailan, gcc-bugs, gcc-gnats, gcc-prs, nobody
Synopsis: Comparisons between double on gcc 2.96
State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Mon Dec 10 11:43:54 2001
State-Changed-Why:
Reproduced with gcc 3.0 and gcc 3.1 on Linux on x86.
The problem goes away if I change your testcase to:
#include <cstddef>
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
double x = 0.0 ;
std::cout << "Testing floating point behaviour" << std::endl ;
for( double i=1 ; i<10 ; i++ )
{
double z = 1.0/i ;
double o_x = x ;
x = x + z ;
printf("i:%g %20.20g %20.20g ", i, z+ o_x, x);
double q = o_x+z;
//if( ! (x==(double)(o_x+z))) std::cout <<"HELP!";
if( ! (x==q)) std::cout <<"HELP!";
std::cout << std::endl;
}
}
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5060&database=gcc
^ permalink raw reply [flat|nested] 6+ messages in thread
* c++/5060: Comparisons between double on gcc 2.96
@ 2001-12-10 4:26 chailan
0 siblings, 0 replies; 6+ messages in thread
From: chailan @ 2001-12-10 4:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 5060
>Category: c++
>Synopsis: Comparisons between double on gcc 2.96
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Dec 10 04:26:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: chailan
>Release: 2.96
>Organization:
>Environment:
Linux 2.4.3-20mdk #1 Sun Apr 15 23:03:10 CEST 2001 i686 unknown
>Description:
Suspicious comparisons between double in following sample.
>How-To-Repeat:
Compile and run to see HELP warnings.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="double.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="double.cc"
CiNpbmNsdWRlIDxjc3RkZGVmPgojaW5jbHVkZSA8aW9zdHJlYW0+CgppbnQgbWFpbigpCnsKICAg
ZG91YmxlIHggPSAwLjAgOwogICBzdGQ6OmNvdXQgPDwgIlRlc3RpbmcgZmxvYXRpbmcgcG9pbnQg
YmVoYXZpb3VyIiA8PCBzdGQ6OmVuZGwgOwogICBmb3IoIHNpemVfdCBpPTEgOyBpPDEwIDsgaSsr
ICkKICAgewogICAgICBkb3VibGUgeiA9IDEuMC9pIDsgICAgICAKICAgICAgZG91YmxlIG9feCA9
IHggOwogICAgICB4ID0geCArIHogOwogICAgICBpZiggISAoeD09KG9feCArIHopKSkgc3RkOjpj
b3V0IDw8IkhFTFAhIjw8c3RkOjplbmRsIDsKICAgfQogICAKfQo=
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-12-12 0:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-11 16:46 c++/5060: Comparisons between double on gcc 2.96 rodrigc
-- strict thread matches above, loose matches on Subject: below --
2001-12-11 16:36 rodrigc
2001-12-10 17:06 Richard Henderson
2001-12-10 11:46 rodrigc
2001-12-10 11:43 rodrigc
2001-12-10 4:26 chailan
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).