My Project  debian-1:4.1.1-p2+ds-4build2
Typedefs | Functions | Variables
sirandom.h File Reference

Go to the source code of this file.

Typedefs

typedef int(* siRandProc) ()
 
typedef int(* siRandProc1) (int)
 

Functions

int siRand ()
 
int siRandNext (int)
 
int siRandPlus1 (int)
 

Variables

int siSeed
 

Typedef Documentation

◆ siRandProc

typedef int(* siRandProc) ()

Definition at line 9 of file sirandom.h.

◆ siRandProc1

typedef int(* siRandProc1) (int)

Definition at line 10 of file sirandom.h.

Function Documentation

◆ siRand()

int siRand ( )

Definition at line 41 of file sirandom.c.

42 {
44  return siSeed;
45 }

◆ siRandNext()

int siRandNext ( int  )

Definition at line 31 of file sirandom.c.

32 {
33  r = A * (r % Q) - R * (r / Q);
34 
35  if ( r < 0 )
36  r += M;
37 
38  return( r );
39 }

◆ siRandPlus1()

int siRandPlus1 ( int  )

Definition at line 46 of file sirandom.c.

47 {
48  return r+1;
49 }

Variable Documentation

◆ siSeed

int siSeed

Definition at line 29 of file sirandom.c.

M
#define M
Definition: sirandom.c:24
siRandNext
int siRandNext(int r)
Definition: sirandom.c:31
siSeed
int siSeed
Definition: sirandom.c:29
R
#define R
Definition: sirandom.c:26
Q
#define Q
Definition: sirandom.c:25
A
#define A
Definition: sirandom.c:23