This wiki is out of date, use the continuation of this wiki instead

Rand

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:23, 8 July 2007 (edit)
Sandman (Talk | contribs)

← Previous diff
Revision as of 03:04, 10 January 2008 (edit) (undo)
Sandman (Talk | contribs)
m
Next diff →
Line 6: Line 6:
Returns a random number, ranging from a certain lower limit to a certain upper limit. The limits are within the range. Returns a random number, ranging from a certain lower limit to a certain upper limit. The limits are within the range.
 +
 +Make sure the difference between ''lowerlimit'' and ''upperlimit'' does not exceed 32767 (2^15).
== Parameters == == Parameters ==

Revision as of 03:04, 10 January 2008


Contents

Definition

INT rand ( <INT lowerlimit> , <INT upperlimit> )

Returns a random number, ranging from a certain lower limit to a certain upper limit. The limits are within the range.

Make sure the difference between lowerlimit and upperlimit does not exceed 32767 (2^15).

Parameters

INT lowerlimit - The lower limit for the random value.
INT upperlimit - The upper limit for the random value.

Returns

INT : A random value: lowerlimit <= result <= upperlimit

Notes

To synchronize rand() on different computers, the function rand_seed() can be used.

Personal tools