Open sandboxFocus

Method Random

Random(double)

Returns true randomly, with a chance given by the threshold.

Declaration
public static bool Random(double threshold)
Parameters
Type Name Description
double threshold

The probability with which the method returns true. For example, if threshold is 0.54, then this method returns true with probability 54%.

Returns
Type Description
bool
Remarks

This function is only available in the Sample expression.