c++ - Typecasting processed float value to int reduces the actual value -


in c++, floor(9099.96 *100.0) giving me answer 909995. expecting 909996.

i not able think of explanations here. appreciated.thanks.

this proper result: according ieee754 calculator, value of 9099.96 represented 9099.9599609375 in double. after multiplication 100 909995.99609375. taking floor gives 909995.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -