The stricfp is used to create the so-called extended accuracy.
This extended accuracy was created due to the need for some programmers to need more precise computation over floating point values.
EX:
Given the following instruction:
double result = val1 * val2 / val3;
What happened was this: many Intel processors computed val1 * val2 and left the result in an 80bit register and only after dividing by val3 did they truncate back to 64bit. This situation generated a more accurate result and less prone to bursting of exponents, but the result was different from the computations that used 64bits all the time.
What happened was, the specification of the Java Virtual Machine required all intermediate computations to be truncated, that is, even if the processor could perform intermediate computation by recording the result in an 80bit register, the JVM caused all intermediary operations to be truncated, which caused discontent in the JAVA community as it slowed down the operation (truncated computing takes longer than more accurate computations) and made it more prone to exponent bursts.
The creation of strictfp was precisely to address this issue of performance optimization and also the question of accuracy of results. Now, in case the user needs greater accuracy in their result and better performance, he can use strictfp.
source: http://javafree.uol.com.br/topic-863961-Uso-do-strictfp.html
Suggested response improvement: strictfp can diminish the accuracy and speed of execution, its advantage is to be predictable, running the same on any processor, be it x86, ARM, SPARC, etc.
– marcus
@thanks for the remark but the problem was another. I was talking about the default current Java to show why it was necessary to create the
strictfp
.– Maniero
Yes, I saw your edition (adding "non") and now I understood that the intention was to explain how it works without strictfp.
– marcus