0

What is strictfp?

12th Feb 2017, 7:36 PM
abolfazl
abolfazl - avatar
2 Answers
+ 3
It's a keyword that can be used on classes, methods, and Interfaces, It stands for strict floating point. It is used when identical precision is necessary across all platforms. It forces the precision of floating point calculations from the JVM regardless if that system could produce a more precise calculation. Otherwise the JVM is allowed to use extra precision where available. Example: Pi on machine A could produce something like: 3.14159265358979323846 While Pi on machine B could produce something like: 3.14159265358979323846264338 <-- more precision Using strictfp would ensure that both machine A and B give the same results by restricting precision: 3.1415926535897932 Note this is an example and not the actual representation of the amount of precision that would be received. more info: http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.4
12th Feb 2017, 9:44 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
thanks
13th Feb 2017, 4:42 AM
abolfazl
abolfazl - avatar