Strictfp从每个平台的浮点计算中得到完全相同的结果。 如果不使用strictfp,则JVM实现可以在可用位置使用其他精度。
Within an FP-strict expression,all
内部valuesmustbeelements
of the float value set or the double
value set,implying that the results
ofal LFP-strictexpressionsmustbe
thosepredictedbyieee 754阵列
onoperandsrepresentedusingsingle
and double formats. Within an
expression that is not FP-strict,some
leeway is granted for an
implementation to use an extended
exponent range to represent
intermediate results; net effect,
roughly speaking,is that a
calculationmightproduce“the correct”
answer“insituationswhereexclusive”
use of the float value set or double
valuesetmightresultinoverflowor
撤消流。
这意味着通过一次写入确保一次执行实际上在一次写入的同时会得到错误结果。
使用strictfp你的结果是可移植的,如果没有,他们很可能更准确。