if i multiply a number by float....and want get the integral part of the product
i used
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int y=floor( 8700 * 0.94 );
cout<<y<<endl;
}
o/p=8177
but it should be 8178
please tell why is it differing ...and how to correct it