This is the ThingsDB documentation for version v0, click here for the latest version!

rand

Returns pseudo-random number between 0.0 and 1.0.

Do not use rand() when the purpose is security related since the linear congruential algorithms used by this function are too easy to break.

This function does not generate an event.

Function

rand()

Arguments

None

Return value

A pseudo-random float number between 0.0 and 1.0.

Example

Some examples on how raise() can be used:

// Return a pseudo-random number between 0.0 and 1.0
rand();

Example return value in JSON format:

0.54747654169214726