public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11914] New: comparing doubles
@ 2003-08-14 5:23 birger dot b at gmx dot net
2003-08-14 5:24 ` [Bug c/11914] " birger dot b at gmx dot net
2003-08-14 7:28 ` ehrhardt at mathematik dot uni-ulm dot de
0 siblings, 2 replies; 3+ messages in thread
From: birger dot b at gmx dot net @ 2003-08-14 5:23 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11914
Summary: comparing doubles
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: birger dot b at gmx dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
Overview Description: More detailed expansion of summary.
Drag-selecting any page crashes Mac builds in NSGetFactory
Steps to Reproduce:
Compile and run
Actual Results:
Program's output:
shouldn't be here
ok!
ok!
Expected Results:
ok!
ok!
ok!
Build Date & Platform:
[lee@yavin strange]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Additional Builds and Platforms:
On sparc-sun-solaris2.6 the output is also not as expected but not
the same as on Linux:
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
gcc version 2.95.2 19991024 (release)
Program's output:
ok!
shouldn't be here
ok!
The following is the *.i file:
# 1 "exp.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "exp.c"
int printf(const char *format, ...);
double two = 2;
double five = 5;
const double f() {
return five;
}
int main () {
# 21 "exp.c"
if(two/f() == two/f()) {
printf("ok!\n");
}
else {
printf("shouldn't be here\n");
}
if((long double)two/f() == two/f()){
printf("ok!\n");
}
else {
printf("shouldn't be here\n");
}
if(two/five == two/five){
printf("ok!\n");
}
else {
printf("shouldn't be here\n");
}
return 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/11914] comparing doubles
2003-08-14 5:23 [Bug c/11914] New: comparing doubles birger dot b at gmx dot net
@ 2003-08-14 5:24 ` birger dot b at gmx dot net
2003-08-14 7:28 ` ehrhardt at mathematik dot uni-ulm dot de
1 sibling, 0 replies; 3+ messages in thread
From: birger dot b at gmx dot net @ 2003-08-14 5:24 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11914
------- Additional Comments From birger dot b at gmx dot net 2003-08-14 05:24 -------
Created an attachment (id=4602)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4602&action=view)
Preprocessed source code exp.i
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/11914] comparing doubles
2003-08-14 5:23 [Bug c/11914] New: comparing doubles birger dot b at gmx dot net
2003-08-14 5:24 ` [Bug c/11914] " birger dot b at gmx dot net
@ 2003-08-14 7:28 ` ehrhardt at mathematik dot uni-ulm dot de
1 sibling, 0 replies; 3+ messages in thread
From: ehrhardt at mathematik dot uni-ulm dot de @ 2003-08-14 7:28 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11914
ehrhardt at mathematik dot uni-ulm dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
------- Additional Comments From ehrhardt at mathematik dot uni-ulm dot de 2003-08-14 07:28 -------
Though often reported this is not a bug. See the section
titled "Problems with floating point computations." on
http://gcc.gnu.org/bugs.html.
*** This bug has been marked as a duplicate of 323 ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-08-14 7:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-14 5:23 [Bug c/11914] New: comparing doubles birger dot b at gmx dot net
2003-08-14 5:24 ` [Bug c/11914] " birger dot b at gmx dot net
2003-08-14 7:28 ` ehrhardt at mathematik dot uni-ulm dot de
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).