Re: A89: Random routines
[Prev][Next][Index][Thread]
Re: A89: Random routines
>How exactly do random routines work? If you run a random routine on two
>calcs with identical RAMs, wouldn't the routine output the same "random"
>numbers?
A random number generator performs some long operation on a randSeed value,
then returns everything after the decimal.
:rand()
:Func
:function(randSeed)->randSeed
:fPart(randSeed)->randValue
:Return randValue
:EndFunc
Where randSeed is a global variable like errornum.
If you set the randSeed to be the same on two different calcs -- in BASIC
<someNumber> -> rand() -- then yes, each rand() will produce matching
output.
--Nate
References: