PGARandomFlip5
Flip a biased coin and return pga_true if the coin is a "winner."
Usage
#include "pgapack.h" int PGARandomFlip(ctx, p) PGAContext *ctx double p
Overview
Otherwise, return PGA_FALSE.
Input parameters
ctx
|
- context variable |
|---|---|
p
|
- biased probability (.5 is a fair coin) |
Output parameters
- none
Location
random.c
Examples
Example: To return PGA_TRUE approximately seventy percent of the time, use PGAContext *ctx; int p; : PGARandomFlip(ctx, 0.7)
Releases
Unchanged in 4 releases since Debian 5.0 (Lenny).