random#
Return a random number.
Available in: math cells, REPL.
Syntax#
random()
random(max)
random(min, max)
random(size)
random(size, max)
random(size, min, max)
Arguments and behavior#
Returns a random value; no fixed sample is promised. The example checks its range instead of asserting an exact draw. The example returns scalar (boolean).
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
random() >= 0 and random() < 1Interactive examples could not load. You can still copy the expressions.
Expected result: true.