Re: TIB:RNG


[Next][Index][Thread]

Re: TIB:RNG



Josh56789@aol.com wrote:
> 
> << Can anyone tell me how to use a random number generator on a TI 85?
> 
>                         Thanks,
>                         -Aaron >>
> To create a random number just enter "rand", this will give you a random
> number 0 to 1.  To create random numbers greater than 1 just multiply by  the
> max random number possible> rand*5 (random 0 to 5). To get whole numbers
> instead of decimals put "int" before the rand> int rand*5(either, 1,2,3,4 or
> 5).


You would have to add 1 as, for instance, int(0.5)=0 and the maximum is
int(4.99.....)=4

That is, to get a random number from 1 to 5, you write:

int(rand*5)+1

-- 
          Rene Kragh Pedersen
------------------------------------------------------------------
What's up???
Um, like it's the direction of increasing gravitational potential.
------------------------------------------------------------------


References: