You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Due to the nature of floating path arithmetic, almost all floating point arithmetic is imprecise. The computer can only maintain a finite number of digits. As a result, it is impossible to precisely represent repeating binary-representation values, such as 1/3 or 1/5.

When precise computations are necessary, consider alternative representions that may be able to completely represent your values. For example, if you are doing arithmetic on decimal values and need an exact rounding mode based on decimal values, represent your values in decimal instead of using floating point, which uses binary representation.

When precise computation is necessary, carefully evaluate the commulative error of the computations, regardless of whether decimal or binary is used, to ensure that the resulting error is within tolerances.

References

http://grouper.ieee.org/groups/754/ IEEE 754 Committee working page

http://www.open-std.org/JTC1/SC22/WG11 ISO Language Independent Arithmetic Standard

  • No labels