[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
XPrandom()
Return a random number
------------------------------------------------------------------------------
Function: XPrandom()
this function returns a Random number, when
XPrandomize() has not been called, the seed
used was 100*seconds(), otherwise the seed
given to XPrandomize() is used, and the Random
numbers generated are the same, this is called a
pseudo Random generator, and can be useful for test
purposes, where one wants the same behaviour for the
testing of some routines.
Note that making Truly Random generators (pseudo or not)
is not trivial. This function is provided "as is", and I
can't guarantee the "Randomness" of the output. Tests have
been good enough for me, but might not be good enough for
some applications.
Syntax: XPrandom([nBound]) --> nRandom
Arguments: nBound specifies an optionnal bound for the random
numbers to generate. When omitted, the number returned
is 0 <= x < 1, otherwise, the number returned is an
integer between 0 <= x < nBound.
Returns:
Usage: XPrandom(100)
* - Returns an integer number between 0 and 99.
XPrandom()
* - Returns a number between 0 and 1 (exclusive).
See Also:
XPrandomize()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson