devxlogo

What Does “strictfp” Do?”

What Does “strictfp” Do?”

When this modifier is specified, the JVM sticks to the Java specifications and returns the consistent value independent of the platform. That is, if you want the answers from your code (which uses floating point values) to be consistent in all platforms, then you need to specify the strictfp modifier.

Java’s default class Math uses this strictfp modifier as shown below

public final strictfp class Math{     }
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist