Hello .. I'm in front of a problem that I'm supposed to print the result of :
5.1234 ^ 15
the result is :
43992025569.928573701266488041146654993318703707511666295476720493953024
using { cout<<variable; } where variable holds the result ..
the problem is the number is printed by scientefic way (exponential) or approximated .. how can I print the full number as it is untill its last digit ?
Use statement cout<<fixed<<setprecision(5)<<variable;. Number within () is the no of digits after decimal point.
Check it out. I am a learner so expect errors.
O... yes. Few Bytes for float and double variables can not accommodate such a huge number(not wrt value but wrt length), thus precision is lost during calculations.Is it??????????? I think above statement works with available number of digits after decimal pt.
thanks all for replying ... but for some idea someone told me that i can store the value in a string and output the string itself, but gave no further explination ..
Well, you can't even compute the number to that many digits of precision, let alone output it. Your problem is in the computation of the number, not in the output of it.