[DGD] Float precision loss

Felix A. Croes felix at dworkin.nl
Thu Apr 28 12:16:01 CEST 2005


=?ISO-8859-1?Q?Petter_Nystr=F6m?= <md1pette at mdstud.chalmers.se> wrote:

> I have run into a behaviour that looks very much like a bug to me.  I am 
> running DGD 1.2.96 and just wanted to hear if there is a known fix to this 
> in later released versions?
>
> This is what I get:
>
> <> eval 4.3 + 5.0 - 4.3 - 5.0
> $6 = 5.8207661e-11

This has already been answered, but notice the difference with

    (4.3 + 5.0) - (4.3 + 5.0)

There is usually a way to reorganize the expression to get the result
(closer to what) you want.

In some cases, DGD masks underlying representation problems.  For example,
try evaluating

    1.1

in LPC and in Python.


>[...]
> If anyone knows what this is all about, please let me know also.  I will 
> try upgrading to the lastest experimental version.

Upgrading to the latest version is always a good idea. :)

Regards,
Dworkin



More information about the DGD mailing list