Float precision and float equality

dbd dbd at ieee.org
Thu Dec 10 13:46:17 EST 2009


On Dec 7, 12:58 pm, Carl Banks <pavlovevide... at gmail.com> wrote:
> On Dec 7, 10:53 am, dbd <d... at ieee.org> wrote:
> > ...
>
> You're talking about machine epsilon?  I think everyone else here is
> talking about a number that is small relative to the expected smallest
> scale of the calculation.
>
> Carl Banks

When you implement an algorithm supporting floats (per the OP's post),
the expected scale of calculation is the range of floating point
numbers. For floating point numbers the intrinsic truncation error is
proportional to the value represented over the normalized range of the
floating point representation. At absolute values smaller than the
normalized range, the truncation has a fixed value. These are not
necessarily 'machine' characteristics but the characteristics of the
floating point format implemented.

A useful description of floating point issues can be found:

http://dlc.sun.com/pdf/800-7895/800-7895.pdf

Dale B. Dalrymple



More information about the Python-list mailing list