A
Alexander Dong Back Kim
Dear all members,
I know this question might sound "beginner" but I can't find any handy
way of achieving "dynamic length of double precision ouput".
Let me show my example first...
double a = 1.123456789012334567890;
double b = 1.000000000000000000001;
double c = 1.123450000012345000000;
There are 3 different double values as you can see above. I wonder is
there any way that I can build strings of the double values without
unnecessary "0" at the end of the values.
the strings should be "1.1234567890123456789" for a,
"1.000000000000000000001" for B and "1.123450000012345" for C.
I tried to use io manipulators such as scientific, fixed and
setprecision but found out that none of them can achieve what I'm
trying to do here.
Any suggestions or hints will be much much appreciated!
Regards,
Alex
I know this question might sound "beginner" but I can't find any handy
way of achieving "dynamic length of double precision ouput".
Let me show my example first...
double a = 1.123456789012334567890;
double b = 1.000000000000000000001;
double c = 1.123450000012345000000;
There are 3 different double values as you can see above. I wonder is
there any way that I can build strings of the double values without
unnecessary "0" at the end of the values.
the strings should be "1.1234567890123456789" for a,
"1.000000000000000000001" for B and "1.123450000012345" for C.
I tried to use io manipulators such as scientific, fixed and
setprecision but found out that none of them can achieve what I'm
trying to do here.
Any suggestions or hints will be much much appreciated!
Regards,
Alex