This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15437] New: int vs const int computation: different answers
- From: "lani at oas dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 May 2004 16:22:48 -0000
- Subject: [Bug c/15437] New: int vs const int computation: different answers
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#include <iostream.h>
int main(){
int x = 1000;
const int y = 1000;
cerr << "f(x) = " << (int)(x*0.3) << endl;
cerr << "f(y) = " << (int)(y*0.3) << endl;
}
/*
Produces Output:
f(x) = 299
f(y) = 300
??????????????????????
*/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- System type: Redhat Linux on Intel machine
- No special compile options (eg g++ main.cpp)
--
Summary: int vs const int computation: different answers
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lani at oas dot ca
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15437