tags:

views:

376

answers:

2

What is the use of Strictfp method in java?

+4  A: 

strictfp is a method or class modifier that forces the JVM to do floating point math a certain way that is guaranteed to be the same across different JVM implementations (stopping the JVM from cutting corners to improve performance and possibly lose some precision / accuracy).

More information can be found on the wikipedia entry, but it's low on detail. Hardcore information (if you care) can be found in the JVM spec.

SCdF
+1  A: 

strictfp makes sure that the floating-point operations in the marked code will act the same across all platforms. It's something you might use in 2D/3D programming where you need to make certain you get exactly the same results regardless of what platform you run the program on.

Max Stewart