[REBOL] Re: Math bug?
From: alekk::obywatel::pl at: 30-Jun-2001 0:42
----- Original Message -----
From: "mb" <[mbicanic--open--hr]>
To: <[rebol-list--rebol--com]>
Sent: Friday, June 29, 2001 9:52 PM
Subject: [REBOL] Math bug?
> Hi,
> can you please test this code on your systems ?
>
> test-bug: does [
> sum: aaa: count: 0
> echo %res
> loop 10000 [
> aaa: aaa + 1
> bbb: aaa / 10
> sum: sum + 0.1
> if sum <> bbb [ count: count + 1
> print [aaa " :: " sum " <> " bbb ]
> sum: bbb
> ]
> ]
> print [ "count:" count ]
> echo none
> ]
>
> Any errors ?
> I've got 297 errors on my Amiga, and similar results with Windows 95/98 on
work.
> mb
Quite interesting (windows 98).
[loop number :: count from previous error :: sum <> bbb]
at start:
67 :: 66 :: 6.69999999999999 <> 6.7
80 :: 13 :: 8 <> 8
; 2^3
123 :: 43 :: 12.3 <> 12.3
160 :: 37 :: 16 <> 16
; 2^4 yet nothing interesting except of bug :)
182 :: 22 :: 18.2 <> 18.2
204 :: 22 :: 20.4 <> 20.4
227 :: 23 :: 22.7 <> 22.7
249 :: 22 :: 24.9 <> 24.9
272 :: 23 :: 27.2 <> 27.2
294 :: 22 :: 29.4 <> 29.4
317 :: 23 :: 31.7 <> 31.7
; and in between 2^5
363 :: 46 :: 36.3000000000001 <> 36.3
; some errors - second column is 45 until...
633 :: 45 :: 63.3000000000001 <> 63.3
; of course...
662 :: 29 :: 66.1999999999999 <> 66.2
; shift - now second column is (22, 23), and now...
1280 :: 11 :: 128 <> 128
; one 43 and 45 rulez! But loop is going...
2560 :: 22 :: 256 <> 256
; gotcha! Now 22 - 23
Of course not forever - there are so many powers of two...
It's not a bug it is pentium ;)
Aleksander K.
[alekk--obywatel--pl]