Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

312 RND random Purpose To generate a random number. What exactly this function does is determined by the number which follows the word RND . RND by itself generates a random whole number between -2147483648 and 2147483647. RND(-X) returns the value -X and resets the random number generator to a number based on X. RND(0) repeats the last random number given by RND(1) . RND(1) generates a random number between 0 and 0.999999. RND(X) generates a random whole number between (and possibly including) 1 and X. The parentheses are compulsory and must immediately follow the word RND with no intervening space.

Examples PRINT RND(6) 340 largenumber%=RND 950 PRINT RND(1) Description A function generating a random number. The range of the number generated depends on the argument (if any). Syntax = RND [( )] Associated keywords None