Really a simple question, but maybe someone can explain. I have 2 lines of code:
long millisPerYear = 365*24*60*60*1000; System.out.println("millis per year = " + millisPerYear);
I expect an exit of 31,536,000,000, but I get 1,471,228,928.
If I remove 1000 from the formula, the answer is correct, but 1000 pushes it to the edge.
The format of the variables is Long , so the size should be 2 64 large enough. I am at a standstill why the values ββare not stored exactly.
java math
Azzaclazza
source share