大家好,欢迎来到IT知识分享网。
保证浮点运算的结果不受平台的影响,在任何平台上,使用统一的标准进行浮点运算,提高程序的可移植性(毕竟结果更可控,更精确),相应的,以降低性能为代价
Strictfp ensures that you get exactly the same results from your floating point calculations on every platform. If you don’t use strictfp, the JVM implementation is free to use extra precision where available.
In other words, it’s about making sure that Write-Once-Run-Anywhere actually meansWrite-Once-Get-Equally-Wrong-Results-Everywhere.(幽默啊)
With strictfp your results are portable, without it they are more likely to be accurate.
转自:http://stackoverflow.com/questions/517915/when-should-i-use-the-strictfp-keyword-in-java
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/14292.html