For the following print statement
std::cout << 10.1 / 0.1 << " " << (int)(10.1 / 0.1) << std::endl;
My understanding is that (10.1/0.1)
is 101.0
hence after typecasting as an int the result should be 101
. Instead I received 101 100
. Can somebody please explain me why it is so???