Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Electricity440 on April 18, 2013, 08:40:51 pm
-
How can I generate a random integer from 0 to 36 and store it to a variable in axe? ???
-
The command 'rand' generates a random number from 0 to 65535. To restrict that range to a smaller range, you can use the modular arithmetic operator ^ like so: rand^37. This divides the random number by 37 and returns the remainder. By the nature of the remainder, its range is from 0 to N-1 when you divide by N, so this function returns your desired number from 0 to 36.
-
ok. thanks :hyper: