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

Run Example

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

Run Example

writeDump( rand() >= 0 && rand() <= 1 );
writeDump( rand( "SHA1PRNG" ) >= 0 && rand() <= 1 );

Last updated

Was this helpful?