chin@sg1.chem.upenn.edu (Chin Wu) (02/18/90)
I just installed G++ on our IRIS 4D using gcc-1.37, g++-1.36.4 and
libg++-1.36.3. Since I have to do a few modifications during my
installion. I don't know if this is a bug or because of some errors I
made when I install the compiler. Following is the program and its
output. It behaves erraneous when deal with "float", but seems all
right using "double". Although I can work around using the "form()",
I, however, like to see the second way to work.
PROGRAM:
#include <stream.h>
main()
{
float f = 0.2;
double d = 0.4;
cout << form("%f\n%f\n", d, f);
cout << d << "\n" << f << "\n";
}
OUTPUT:
0.000000
0.200000
0.4
1.3411e-08 <-- ERROR
chin@sg1.chem.upenn.edu