samedi 25 février 2023

Different rounding between int and double type in c++?

Picture

I am curious about getting different answer just because differnt data type. If it have double precision problem, but why the double type "size2" return the right answer?

(12 000 * 60 * 2.8)/ 8000 = 252 based on ordinary calculator

Aucun commentaire:

Enregistrer un commentaire