From: Don Higgins <[email protected]> Date: Saturday, 26 March 2011 22:05
>Several times in this discussion, it has been implied that using the right >langauge for floating point operations would prevent problems. I would >like to point out that regardless of the language and particular floating >point format you choose such as HFP, BFP, or DFP, there will always be the >opportuntiy for errors to creep into floating point caculations due to the >fact that when two numbers are added, subtracted, multiplied, or divided >the result stored in a floating point format may round or truncate the >result to a finite value which is different from the actual result which >may be an irrational number in a given base such as 1/3 in base 2 or 10. The question of the OP related to obtaining identical results on the mainframe and Windows, not whether the result is equal to the exact result. >There are lots of examples of business caculations that require use of >floating point. One example that comes to mind is the requirement for >many electric utilities to apply a fuel surcharge to monthly electrice >bills. This rate is set by the Florida Public Service commission in >Florida and the staff works out details such as how irrational results >much be rounded to finite charge to be added to the bill. There's no reason that the calculation must be done in floating-point. Decimal fixed point arithmetic is quite adequate for performing such computation.
