Here's a test to see: it only generates out of 1,000,000 loops , it only generates 1,000 below .0010
Code: Select all
screen 19
dim as double l0 = .00000 , h0 = .0001
dim as double l1 = .00011 , h1 = .0002
dim as double l2 = .00021 , h2 = .0003
dim as double l3 = .00031 , h3 = .0004
dim as double l4 = .00041 , h4 = .0005
dim as double l5 = .00051 , h5 = .0006
dim as double l6 = .00061 , h6 = .0007
dim as double l7 = .00071 , h7 = .0008
dim as double l8 = .00081 , h8 = .0009
dim as double l9 = .00091 , h9 = .0010
dim as integer array(0 to 9)
dim as double n = 0
for a as longint = 1 to 1000000
n = rnd
select case n
case l0 to h0 : array(0)+=1
case l1 to h1 : array(1)+=1
case l2 to h2 : array(2)+=1
case l3 to h3 : array(3)+=1
case l4 to h4 : array(4)+=1
case l5 to h5 : array(5)+=1
case l6 to h6 : array(6)+=1
case l7 to h7 : array(7)+=1
case l8 to h8 : array(8)+=1
case l9 to h9 : array(9)+=1
end select
next
dim as longint total = 0
for a as longint = lbound(array) to ubound(array) step 1
print array(a)
total+=array(a)
next
print "total = " ; total
sleep
end