I have a weird problem. Here's part of my code:
int temp=1100;
int foo=floor(0.03*temp);
int foo1=0.03*temp;
if(foo-foo1){
cout<<foo<<endl;
cout<<foo1<<endl;
}
If 3% of temp
= integer then foo
differs from foo1
by 1.
For example:
1100*0.03=33.
foo
=33
foo1
=32.
In addition if i write it like that :
int foo=floor(0.03*1100);
int foo1=0.03*1100;
There is no such problem.
Why?