Rnd

From NSB App Studio
Revision as of 19:04, 8 July 2012 by Brendon (talk | contribs) (Created page with "RND '''Description''' RND returns a single-precision number from a random sequence between 0 and 1. The value is always random: no seed needs to be supplied. '''Example'''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

RND

Description

RND returns a single-precision number from a random sequence between 0 and 1. The value is always random: no seed needs to be supplied.

Example

REM RND Example
'RND generates random numbers
Random
Random
Random
 
SUB Random
   DIM Ret, i
   RET = ""
   FOR i = 1 TO 4
      RET = RET&(INT(100 * RND) +1) & " "
   NEXT
   PRINT "Four random numbers:", RET
END SUB

Output

Four random numbers:6 71 1 19
Four random numbers:33 28 4 51
Four random numbers:33 28 4 51

Related Items

RANDOMIZE