The code:
cout << log(25.0/9.0)/log(5.0/3.0) << endl << floor(log(25.0/9.0)/log(5.0/3.0));
results:
2
1
Why does C++ considers floor(2) = 1?
What I tried: When saving the fraction in a float it returns the correct value:
float a = log(25.0/9.0)/log(5.0/3.0);
cout << a << endl << floor(a);
results:
2
2