Page 1 of 1 1
Topic Options
#77394 - 2001-04-02 10:52 PM RND() bug still in KiX2K
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
My first 'Post New Topic', ok I will quit it with the 'firsts'

I re-ran the rndtest script and this is the results after 397873 runs:

1=132926, 2=132511, 3=132425, 4=11, other=0

This is supposed to return a random number between 1 and 3 inclusive. 11 4's have occured in almost 400 thousand RND()s, that's about 0.00275% error.

rndtest.KiX

code:

break on cls
srnd(val(substr(@time, 7, 2)))
$other="" $four=0


:again


$c=rnd(2)+1
$total=$total+1
select
case $c=1 $one=$one+1
case $c=2 $two=$two+1
case $c=3 $three=$three+1
case $c=4 $four=$four+1
case 1 $other=$other + "$c, "
endselect


at(0,0)
"1=$one, 2=$two, 3=$three, 4=$four, other=$other, total=$total "


goto again


cj

------------------
For more scripts goto my website and click the hammer and spanner icon.

chrismat@ozemail.com.au

Top
#77395 - 2001-04-04 08:20 AM Re: RND() bug still in KiX2K
Anonymous
Unregistered


Thanks for the report. This was indeed broken (in 2001 as well as in the previous versions).

The issue will be fixed in the next public build.

Kind regards,

Ruud

Top
#77396 - 2001-04-04 05:33 PM Re: RND() bug still in KiX2K
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Wow! Thanks dude!

I have shaped the course of the future!

Aussie Aussie Aussie, Oi Oi Oi !

cj

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.05 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.