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

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

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