Java strictfp关键字

保证浮点运算的结果不受平台的影响,在任何平台上,使用统一的标准进行浮点运算,提高程序的可移植性(毕竟结果更可控,更精确),相应的,以降低性能为代价

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://www.cnblogs.com/sean-zou/p/3710016.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值