...
When it is important to obtain consistent results from floating point operations across different JVMs and platforms, use the strictfp
modifier. This modifier requires the JVM and platform to behave as though all floating point computations were performed using values limited to those representable by a standard Java float
or double
, thus guaranteeing that the result of the computations will match exactly across all JVMs and platforms.
Use of the strict_fp
strictfp
modifier lacks impact on platforms that lack platform-specific floating point behavior. It can have substantial impact, however, on both the efficiency and the result values of floating point computations when executing on platforms that implement platform-specific floating point behavior. On these platforms, use of the strict_fp
strictfp
modifier increases the likelihood that intermediate operations will overflow or underflow because it restricts the representable range and precision of intermediate values; it may also reduce computational efficiency. These issues are unavoidable when portability is the main concern.
...