Difference between revisions of "AMOSi:Zandom Number"

From Amiga Coding
Jump to: navigation, search
m (1 revision(s))
 
(Extracted from the AMOSPro V2.00 helpfile)
(No difference)

Revision as of 02:45, 17 November 2007

Generates a random number from -32767 to 32768. The range of the numbers is set via a bit-mask, which is combined with the return value using a logical AND operation. It's easiest to enter the range as just less than an exact power of two, such as 31, 63, 127, or 255. This will provide you with random numbers from 0-31, 0-61, etc.


Let X=Z(255)

The reason for the odd name, is that we ran out of letters! If we`ve had the option, it would have been called R for random!