Dividing a double with integer
- by hardcoder
I am facing an issue while dividing a double with an int. Code snippet is :
double db = 10;
int fac = 100;
double res = db / fac;
The value of res is 0.10000000000000001 instead of 0.10.
Does anyone know what is the reason for this? I am using cc to compile the code.