c++ - Reading double data in cpp with 'e' sign -
this question has answer here:
- is floating point math broken? 20 answers
i have strange problem reading double data in c++ program, why c++ adding nines , how can make him not to?
when gave him 8.62400e+02 save 862.39999999999997726 not 862.4
thank help!
you cannot express values in floats or doubles, that's difference integers. if want rid of 9's when printing value, use appropriate precision specifier in printf() format string, trick, internally, won't ever = 862.4.

Comments
Post a Comment