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

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

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

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -