--
Because many developers want the exact same solution to occur regardless of the underlying hardware, the strictfp keyword was implemented. strictfp insures that the VMS will always use a standardized implementation of floating point numbers, wherever the application/applet is run. Thus continuity across platforms is achieved. When this modifier is specified, the JVM adheres to the Java specifications ( IEEE-754 floating-point specification ) and returns the consistent value independent of the platform.
It can be used as a modifier with top-level classes, both static and non-static inner classes, inner interfaces, both static and instance method declarations. Variables, constructors, static or instance floating blocks can't have this modifier.
If an expression is FP-strict, all intermediate values should fit into the range for float or double variables, implying that the results of all FP-strict expressions must be those predicted by IEEE 754 arithmetic on operands represented using single and double formats. If an expression is not FP-strict, there are no such restrictions.
A non-constant expression is considered FP-strict if any of the class, interface or method declarations that contain the expression have the strictfp modifier.
Comments
Post a Comment