gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [gnugo-devel] Floating point arithmetics


From: Portela Fernando
Subject: RE: [gnugo-devel] Floating point arithmetics
Date: Thu, 16 Sep 2004 17:19:24 +0200

paul wrote:

> As far as I understood (from your description), all distances are
> multipliers of 0.0001, but the problem occurs because one distance
> can be say 1.0000000000001 and can be 0.999999999999, and so the
> comparison may fail or may not.  Can it then be fixed like this:

I spotted this location in the macro and draw conclusions based on
that alone (IMO, that is sufficient for a diagnostic). Unfortunately,
there are a lot more places where such comparisons occur in the
connection code. Rather than look for them all with the potential
risk of missing some, I thought it would be better to get rid of
the problem altogether by being somewhat bold (convert float -> int).

Of course, your EPSILON idea would work the same. On the other hand,
let's imagine we decide to use 0.0000001 and build GnuGO on an
architecture which under circumstances might return poorer (in terms
of precision) results... That's why I prefered directly converting
to integers.

-- nando




reply via email to

[Prev in Thread] Current Thread [Next in Thread]