c++ - Reading double data in cpp with 'e' sign -


this question has answer here:

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

enter image description here

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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -