English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
strictfp is used to ensure that floating-point operations yield the same results on any platform. Since the precision of floating-point numbers may vary between platforms, the strictfp keyword ensures consistency across platforms.
strictfp can be applied to classes, methods, or interfaces, but cannot be applied to abstract methods, variables, or constructors. The following are valid examples of strictfp usage.
strictfp class Test { } strictfp interface Test { } class A { strictfp void Test() { } }
The following is an invalid strictfp usage.
class A { strictfp float a; } class A { strictfp abstract void test(); } class A { strictfp A() { } }