当James Gosling, Herbert和他的团队开发java的时候。他们脑子里有个疯狂的东西叫< em >平台独立性< / em >。他们想让橡木(Java)变得更好,以至于它可以在任何具有不同指令集的机器上完全相同地运行,甚至运行不同的操作系统。但是,在编程语言中,小数点也被称为浮点数和双精度数有一个问题。一些机器的目标是有效的,而其他的目标是准确的。因此,后一种(更精确)机器的浮点数大小为80位,而前一种(更高效/更快)机器的浮点数大小为64位双精度。但是,这违背了我们构建独立于平台的语言的核心思想。另外,当代码在某些机器(64位的两倍大小)上构建并在另一种机器(80位的两倍大小)上运行时,这可能会导致精度/数据的损失。
The output will be so long and not precise, becasue it is precissed by the hardware e.g JVM and JIT has the license
as long as we dont have specify it Strictfp
Marking it Strictfp will make the result Uniform on every hardware and platform, because its precised value will be same
One scenario I can see is in a distributed application (or multiplayer game) where all floating-point calculations need to
be deterministic no matter what the underlying hardware or CPU is.