Originally posted by Mohammed Yousuff:
Will strictfp variable will used in the financial calculations, how much they are extensively used ?
No, because the float and double data types are not suited for financial calculations. These datatypes have limited precision and will cause rounding errors when you do calculations with them, which is unacceptable for financial calculations. The strictfp modifier doesn't change anything about that.
You need something like class BigDecimal for financial calculations.
I think that strictfp is only very rarely used, it's only necessary for specialized applications that need floating point arithmethic which strictly adheres to the IEEE 754 standard, for example for some scientific calculations.
For more info on strictfp, see these sections in The Java Language Specification:
8.1.1.3 - strictfp Classes 8.4.3.5 - strictfp Methods 9.1.1.2 - strictfp Interfaces And especially see
section 15.4 which explains exactly what it means if an expression is FP-strict.
[ April 21, 2008: Message edited by: Jesper Young ]