From: | G.A.Griggs |
Date: | 28 Sep 2000 at 20:18:44 |
Subject: | Re: To sum it up |
Kree Andrew
On 27-Sep-00, you gnashed on about [amigactive] Re: To sum it up:
>AC Hi Everybody,
>AC> Don't sweat it it's just the old .1 problem there's no general way
>AC> round it. you can write a APU system which can handle some cases but
>AC> not all. For a small demonstration try the following BASIC snippet
>AC>
>AC> A=0
>AC> B=.1
>AC> Do
>AC> Print A
>AC> A=A+B
>AC> Loop
>AC If the basic you're using supports double precision numbers then your
>AC problems are solved :)
>AC See ya :)
You seam to be missing the point no matter how precise your FP system is you
will still suffer from the .1 problem the simple fact is that in binary .1
is the same as PI in Decimal you can't get an exact representation. You can
write your maths routines to handle the problem within a certain window but
if there supplied equation generates a result somewhere during the procedure
which falls outside that window WHAM there's that problem again. If you
don't believe me just sit down with pencil and paper and calculate .1 as a
binary number.
Draylan tru
Sex is hereditary. If your parents never had it, chances are you
won't either.
-- Murphy's laws on sex
Quote carefully and read all ADMIN:README mails