W
whatdoineed2do
#include <iostream>
using namespace std;
void convert(const double& d)
{
cout << "before=" << d << " after=";
cout.precision(15);
cout << d << endl;
}
int main()
{
convert(0.1234567890123456789);
convert(1.06144e-305);
return 0;
}
hi,
i'm using the above code to demonstrate a problem we've got. the
first call to convert does what i expect, however the second call
doesnt -- it just looks like it didnt even bother. below is the
ouptput:
before=0.123457 after=0.123456789012346
before=1.06144e-305 after=1.06144e-305
can you tell me what i'm doing wrong? been using Sun's Forte6
compiler
thanks
ray
using namespace std;
void convert(const double& d)
{
cout << "before=" << d << " after=";
cout.precision(15);
cout << d << endl;
}
int main()
{
convert(0.1234567890123456789);
convert(1.06144e-305);
return 0;
}
hi,
i'm using the above code to demonstrate a problem we've got. the
first call to convert does what i expect, however the second call
doesnt -- it just looks like it didnt even bother. below is the
ouptput:
before=0.123457 after=0.123456789012346
before=1.06144e-305 after=1.06144e-305
can you tell me what i'm doing wrong? been using Sun's Forte6
compiler
thanks
ray