I have been trying to do something simple with java floating point division, have read several articles on some minimal changes on values but nothing like I am having below.
This is the expected:
float f = 1789773f / 1000000f;
System.out.printf("\n%.2f", f);
Outputs: 1,79
This is what happens when I work with variables:
int CLOCK=1789773;
System.out.printf("\n%.2f", (float)CLOCK/(10^6));
Outputs: 13410,48
What is going on? I had to use the literal '1000000f' instead of 10^6 to make it work. Also, I thought that casting the one of the division elements with (float) would set everything as float and I would not end doing integer math.