Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ shufrans(3M) — Sun C 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

addrans(3M)

drand48(3)

lcrans(3M)

rand(3C)

rand(3V)

random(3)

SHUFRANS(3M)  —  MATHEMATICAL LIBRARY

NAME

shufrans − random number shufflers

SYNOPSIS

#include <math.h>
 void i_shufrans_(x,n,l,u)
int ∗x, ∗l, ∗u;
int ∗n;
 void u_shufrans_(x,n,l,u)
unsigned ∗x, ∗l, ∗u;
int ∗n;
 void d_shufrans_(x,n,l,u)
double ∗x, ∗l, ∗u;
int ∗n;
 void r_shufrans_(x,n,l,u)
float ∗x, ∗l, ∗u;
int ∗n;
 

DESCRIPTION

These functions shuffle random numbers, uniform on [∗l,∗u], generated by any method.  The shuffling method is that called "Algorithm B" by Knuth.  An internal table of between 4 and 256 elements is allocated for the shuffling depending on ∗n. 

EXAMPLES

to shuffle 1000 double-precision random variates in [lb,ub]

double x[1000] ; int n = 1000 ; double lb, ub;
 d_shufrans_(x, &n, &lb, &ub) ;

FILES

/usr/include/math.h
function declarations

/usr/lib/libm.a function archive

SEE ALSO

addrans(3M), drand48(3), lcrans(3M), rand(3C), rand(3V), random(3). 

Knuth, Seminumerical Algorithms, 1981, Addison-Wesley. 

Park and Miller, Random Number Generators: Good Ones are Hard to Find, Communications of the ACM, October 1988. 

NOTES

The pseudo-random numbers generated by addrans(3M) are suitable for almost every purpose.  Shuffling provides even greater randomness for applications that require it. 

Sun Release 4.0  —  Last change: 22 May 1989

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