c++ - question on variable type "double" -
i have written program , works 3d coordinates (i.e. x,y,z).
input data program like
50903.85 21274.97 15.03 50903.57 21274.96 15.08 50903.33 21274.95 15.17
and got output more columns. so, got same x,y,z output file.
50903.85 21274.97 15.03 50903.57 21274.96 15.08 50903.33 21274.95 15.17
so, program works properly, guess.
then, used data set, having more digits previous data,
512330.98 5403752.71 330.39 512331.01 5403754.18 329.44 512331.06 5403755.59 329.56
and output like;
512331 5.40375e+006 330.39 512331 5.40375e+006 329.44 512331 5.40376e+006 329.56
here, not able real values. , x values rounded. cant think should reason?
in program, used "double" assigning variables x,y,z values. so, know maximum numerical value can refereed double?
if need work long values, should relevant variable?
numbers aren't changing, seeing different notation change there. perhaps using other %f format doubles? see printf format parameters.
better yet, check out stackoverflow question: how avoid scientific notation large numbers?
Comments
Post a Comment