LOG IN SIGN UP
Documentation

randombool()

Returns a random, boolean value. The result is true when, given a pseudorandom number r, (RAND_MAX * numerator) > (r * denominator).

This does not use secure random numbers and should not be used for cryptographic purposes.

This function is not prefixed with the std. namespace.

Format

BOOL
randombool(INTEGER numerator, INTEGER denominator)

Examples

if (randombool(1, 10)) {
  set req.http.X-ABTest = "A";
} else {
  set req.http.X-ABTest = "B";
}