java - java中Strictfp是什么意思?

标签 java access-modifiers

如果有人能用一个例子和一个很好的解释来解释什么是java中的strictfp,那就太好了。 我已经在互联网上搜索过,但仍然无法获得相同的明确解决方案 预先感谢:)

最佳答案

explanation given by the JLS看起来很清楚:

Within an FP-strict expression, all intermediate values must be elements of the float value set or the double value set, implying that the results of all FP-strict expressions must be those predicted by IEEE 754 arithmetic on operands represented using single 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; the net effect, roughly speaking, is that a calculation might produce "the correct answer" in situations where exclusive use of the float value set or double value set might result in overflow or underflow.

有关何时可以使用 strictfp 的讨论,请参阅 When should I use the "strictfp" keyword in java?

关于java - java中Strictfp是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26366463/

相关文章:

java - 如何为图表制作动画

c# - Java 在 C# 中的 final 是什么?

java - 访问修饰符的可访问性

unit-testing - 使用私有(private)/ protected 常量测试类

java - Spring集成应用和缓存

java - Websocket 在打开后关闭连接

java - 理解 Java 的 protected 修饰符

c# - 由于访问修饰符,子控件无法访问

java "database is locked"SQL异常

java - 将 java.lang.Number 实例传递给方法时的 Final 关键字