Floating point problem
Grant Edwards
grant.b.edwards at gmail.com
Sat Apr 18 14:59:50 EDT 2020
On 2020-04-18, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> At the very least, one was taught to not test for equality of two
> floating point values (which also implies one did not test for the
> negation of equality). One either tested for difference
> (greater/less than) or for a delta between values being less than
> some threshold.
> while abs( v - 1.0) > 0.05:
Then the trick is choosing the threshold without doing a day's worth
of trial-and-error test runs.
--
Grant
More information about the Python-list
mailing list