[REBOL] Re: decimal woes
From: ptretter:charter at: 18-Jul-2003 11:30
That must be a bug from what I can gather. You might want to submit that to
feedback via www.rebol.com/feedback.html
Paul Tretter
----- Original Message -----
From: "Maxim Olivier-Adlhoch" <[maximo--meteorstudios--com]>
To: "Rebol-List (E-mail)" <[rebol-list--rebol--com]>
Sent: Friday, July 18, 2003 10:01 AM
Subject: [REBOL] decimal woes
Hi all,
I am having fun converting SEISMIC data (sampled at 5 thousands of a second
:-) within a 30MB file.
I must dump all of this in a 3d animation package (maya) and its working...
except for one point..
decimal datatype is a little unstable, and maybe someone can tell me why
this happens:
if you do:
time: 0
loop 50 [
time: time + 0.02
probe time
]
ask ""
at the end you will have
0.92
0.940000000000001
0.960000000000001
0.980000000000001
but if you then do 0.92 + 0.02
you get 0.94
the floating point error gets worse and worse (and eventually diminishes a
little!!!)
there are only two signifiant digits in all calculus, I am wondering if it
could be possible for the floating point algorythms to be a little more
stable...
I had to an ugly integer calculation workaround divided by 100 to get the
clean decimals...
-max