这是我的代码,但它的输出确实有意义。
long currentTime;
long stateStartTime;
int delta;
float speed;
// I do something
System.out.println();
System.out.println(currentTime);
System.out.println(stateStartTime);
System.out.println(delta);
System.out.println(speed);
System.out.println(delta * speed);
System.out.println(currentTime - (stateStartTime + (delta * speed)));
stateStartTime += delta * speed;
System.out.println(currentTime - stateStartTime);
输出:
1350065634345877
1350065121656832
1
5.0E8
5.0E8
0.0
-24181867
我期待最后两行是:
12689045
12689045
但令人惊讶的是我得到了上述结果。为什么?
喵喔喔
相关分类