[Coco] Re: 6809 example
Roger Taylor
rtaylor at bayou.com
Sun Jan 18 00:37:23 EST 2004
At 11:02 AM 1/17/2004 -0700, you wrote:
>On Sat, 17 Jan 2004, Robert Gault wrote:
>
> > Also if you want the random numbers to range 0-9, change the random
> > number generater to RND(0)*10+48. I was thinking RND gave inclusive
> > values but it clearly is exclusive of the high endpoint.
>
>Why not RND(10)-1? The whole RND(0)... formula is unnecessary in Color
>Basic if you need an integer. RND(0) returns a floating point number
>between 0 and 1. I believe RND(x) where x > 0 gives a number from 1 to x
>inclusive. RND(-x) reseeds the pseudo random number generator.
Yep, RND(0) was the only way on some ancient personal computers, so it gets
used a lot even now. RND(0) always returns a value >0 and <1 and you have
to multiply it by a factor to scale it up. Simply pointless unless you
know something about the random generator that proves to give better
results this way.
----------
Roger Taylor
More information about the Coco
mailing list