Method RandomInterface()->random()


Method random

array random(mapping m)

Description

Returns a random index-value pair from the mapping.

Array
mixed 0

The index of the mapping entry.

mixed 1

The value f the mapping entry.

Throws

Throws an exception if the mapping is empty.


Method random

float random(float max)

Description

This function returns a random number in the range 0 .. max-ɛ.

See also

Random


Method random

int random(int max)

Description

This function returns a random number in the range 0 .. max-1.

See also

Random


Method random

mixed random(object o)

Description

If random is called with an object, lfun::_random will be called in the object.

Throws

Throws an exception if the object doesn't have a _random method.

See also

lfun::_random()


Method random

mixed random(array|multiset x)

Description

Returns a random element from x.

Throws

Throws an exception if the array or multiset is empty.