As far as I understand strictfp
is limited to scope marked with this keyword. This means that it causes calculations of marked class or method to be portable.
It cannot propagate the effect to referenced code. For example if foo()
is strictfp
but it calls bar()
from some other class that is not strictfp
, the calculations inside bar()
will not be portable, but calculations inside foo()
will be. So, if results of bar()
are used in foo()
the overall result might be not portable.
public strictfp double foo() {
return bar() * 3.1415926;
}
public double bar() {
return 2.718281828 * 2.0;
}
This result 2.718281828 * 2.0
is not portable, but its multiplication by 3.1415926
is.