If anyone can explain me what is strictfp in java with an example and a good explanation then that will be great. I have already search the internet but still I am unable to get the clear solution for the same Thanks in advance :)
-
3possible duplicate of [When should I use the "strictfp" keyword in java?](http://stackoverflow.com/questions/517915/when-should-i-use-the-strictfp-keyword-in-java) – ajp15243 Oct 14 '14 at 17:15
1 Answers
The explanation given by the JLS seems pretty clear:
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.
For a discussion of when one might use strictfp
, see When should I use the "strictfp" keyword in java?
-
I read this but wanted some practical implemented answer such that I can have a clear idea about the same – CSG0811 Oct 14 '14 at 17:28