Tasks that choose random numbers or list elements.
[RandomElement
list]
Sets element to a random element of list. It is non-deterministic; it will try all elements, but it tries them in a random order, so it chooses a random successful branch of the choice tree.[RandomFloat
min]
Sets random to a random number1 such that min \(<=\) random \(<=\) max. It is deterministic: it will only try one random number; if it doesn't work, the call fails.[RandomIntegerExclusive
min]
Sets random to a random integer (whole number) such that min \(<=\) random \(<=\) max. It is deterministic: it will only try one random number; if it doesn't work, the call fails.[RandomIntegerInclusive
min]
Sets random to a random integer such that min \(<=\) random \(<\) max. It is deterministic: it will only try one random number; if it doesn't work, the call fails.
Notes
-
The name comes from the fact that it can generate numbers that aren't whole numbers. These are known as “floating-point” numbers or
float
s in most programming languages. ↩