Rand
Return a random double between 0 and 1
Method Signature
Rand(algorithm=[string])
Arguments
Argument
Type
Required
Description
Default
algorithm
string
false
The algorithm to use to generate the random number.
Examples
simple example Using rand()
To generate a random number between 0 to 1
writeOutput( rand() );
simple example Using rand() with algorithm
To generate a random number between 0 to 1 by using bxmX_COMPAT algorithm
writeOutput( rand( "bxmX_COMPAT" ) );
Additional Examples
writeDump( rand() >= 0 && rand() <= 1 );
writeDump( rand( "SHA1PRNG" ) >= 0 && rand() <= 1 );
Related
Last updated
Was this helpful?