2.1.16.1.17 rnd


Description

Also defined as ran(_nSeed). On every call it generates a random double value between 0. and 1.

Syntax

double rnd( int nSeed = 0 )

Parameters

nSeed
(optional) pass positive value, returns 0; pass any nonzero negative value to set the seed for random number generation, or 0 to use the default seed.

Return

A uniformly random number between 0. and 1.

Examples

EX1

// The example displays 10 random numbers between 0. and 1.
void    rnd_ex1()
{
    for (int ii = 0; ii < 10; ii++)
    {
        double    rr = rnd();
        out_double("value = ", rr);
    }
}

Remark

See Also

rand

Header to Include

origin.h

Reference