This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Data read incorrectly, by changing compiler's version.
- From: H S Rai <hsraidce at iitr dot ernet dot in>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 12 Nov 2002 13:07:08 +0530 (IST)
- Subject: Data read incorrectly, by changing compiler's version.
I used following simple program on RedHat 7.1 with g++ 2.96, which
gave correct result, for data file having value near "inf" with large
number of significant digits.
But same program on g++ 3.2 (RedHat 8.0) gave incorrect result. Even
to compile, I need to change "endl" to "\n" and have to use
"-Wno-deprecated" option.
Can some one point out mistake?
--
H.S.Rai
=====================================================
Data file
=====================================================
1.797693134862316E+308 50
100
=====================================================
Result from g++ 2.96 on RedHat 7.1
=====================================================
inf
50
100
=====================================================
Results from: g++ 3.2 on RedHat 8.0
=====================================================
2.00102e+10
4.85543e-270
2.00102e+10
=====================================================
Program
=====================================================
#include <fstream.h>
ifstream fin("m.in");
ofstream fout("m.out");
int main()
{
double a, b, c;
fin >> a >> b >> c;
fout << a << endl << b << endl << c << endl;
return 0 ;
}
=====================================================
end of mail.