Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (2) — Plan9 3rd Edition (Vita Nuova)

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

security-random(2)

RAND(2)

NAME

rand − pseudo random number generation

SYNOPSIS

include "rand.m";
rand = load Rand Rand->PATH;
 init:    fn(seed: int);
rand:    fn(modulus: int): int;
bigrand: fn(modulus: big): big;

DESCRIPTION

­Init initialises the pseudo-random number generator with seed; subsequent calls to ­rand and ­bigrand return a pseudo-random sequence of integers or bigs respectively, between 0 and modulus−1. ­Modulus should be a non-negative integer; for bigrand, it should be less than 2^53. 

SOURCE

­/appl/lib/rand.b

SEE ALSO

security-random(2)

BUGS

The quality of the algorithm currently used is questionable. 

Plan 9  —  June 29, 2000

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026