The strictfp keyword in java

Reading Time: < 1 minute

Today while I was preparing for OCP, I’ve come to meet a new non access modifier keyword called strictfp. Simply the keyword Strictfp ensures that you retrieve the same results of the floating point calculations on every platform X86 or AMD64. in case of not utilizing the keyword strictfp, the JVM implementation you use will result in using extra precision where its feasible. This keyword is available in Java since version 1.2. Furthermore, you can declare with this keywords;


public strictfp class MyClass {}


public strictfp interface MyInterface{}


public class MyCalculationClass(){
	public strictfp float calculation(float a, float b){
        return (a*b);