Home Help Java S strictfp
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

strictfp

Advertisement
strictfp is a Java keyword that restricts floating-point calculations in order to ensure portability.

strictfp

     

strictfp is a Java keyword that restricts floating-point calculations in order to ensure portability. The modifier was added to the Java programming language with the Java virtual machine version 1.2.

Older versions of JVMs were always use strict floating-point, means all values used during floating-point calculations are made in the IEEE-standard float or double sizes. This sometimes result in a numeric overflow or underflow during calculation, even if the end result would be a valid number. However JVM 1.2, does not restrict to all the numbers used in floating-point calculations limited to the standard float or double precision.

While some applications, might require having precisely the same floating-point behavior for every platform, even if some platforms could handle more precision. In such situations, a programmer is free to use the modifier strictfp to make sure that calculations are performed as in the earlier versions?only with floats and doubles.

The modifier can be combined with classes, interfaces and methods.

Strict floating point behavior are typically used by compile-time constant expressions. While other expressions use strict floating-point math whenever they are contained in a method, interface, or class which uses the strictfp modifier in its declaration.

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 17, 2009

Related Tutorials

Ask Questions?    Discuss: strictfp  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
priyank jain
March 19, 2012
strictfp clarification

plz tell me when we use and how it will work and what is role of IEEE standered ......
DMCA.com