PGARandomFlip(3)

PGARandomFlip3

Flip a biased coin and return pga_true if the coin is a "winner." otherwise, return pga_false.

Usage

#include "pgapack.h"
int  PGARandomFlip(ctx, p)
PGAContext *ctx
double p

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

8 releases since Debian 1.1 (Buzz); the text changed 1 time.

  1. 1.1
  2. 1.2–3.1

From pgapack 1.0.0.1-3 in Debian 3.1 (Sarge). Parsed by carta from the page's man source.