Home > DeveloperSection > Interviews > explain about strictfp keyword in Java ?

Posted on    July-09-2015 12:25 AM

 Java Java 
Ratings:
 1 Answer(s)
  466  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    July-09-2015 12:25 AM

If we want floating point values to be consistent across platforms, then we need to use "strictfp" as per IEEE 754 standard. When a program runs on multiple platforms, precision of floating point differ which in turn given different results. strictfp helps to enforce the precision across all platforms. For example:
Class Level - public strictfp class StrictFpModifierExample{}
Method Level - public strictfp void example() {}

Don't want to miss updates? Please click the below button!

Follow MindStick