My Project  debian-1:4.1.2-p1+ds-2
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

EXTERN_VAR 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 42 of file sirandom.c.

43 {
45  return siSeed;
46 }

◆ siRandNext()

int siRandNext ( int  )

Definition at line 32 of file sirandom.c.

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

◆ siRandPlus1()

int siRandPlus1 ( int  )

Definition at line 47 of file sirandom.c.

48 {
49  return r+1;
50 }

Variable Documentation

◆ siSeed

EXTERN_VAR int siSeed

Definition at line 6 of file sirandom.h.

M
#define M
Definition: sirandom.c:25
siRandNext
int siRandNext(int r)
Definition: sirandom.c:32
siSeed
VAR int siSeed
Definition: sirandom.c:30
R
#define R
Definition: sirandom.c:27
Q
#define Q
Definition: sirandom.c:26
A
#define A
Definition: sirandom.c:24