Double Precision in CPP?

Revision en1, by hungrytired, 2020-07-13 08:10:56

I was trying out this question on AtCoder, https://atcoder.jp/contests/abc169/tasks/abc169_c. Actually in cpp i was doing double a = 9.79 and then long long b = 9.79*100 and weird thing b was assigned 978 not 979. I am confused why is this happening. If someone can put a blog link which might explain the problem further. Thanks a lot.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English hungrytired 2020-07-13 08:10:56 360 Initial revision (published)