FreeBASIC  0.91.0
math_rnd.c File Reference
#include "fb.h"
Include dependency graph for math_rnd.c:

Go to the source code of this file.

Macros

#define RND_AUTO   0
 
#define RND_CRT   1
 
#define RND_FAST   2
 
#define RND_MTWIST   3
 
#define RND_QB   4
 
#define RND_REAL   5
 
#define INITIAL_SEED   327680
 
#define MAX_STATE   624
 
#define PERIOD   397
 

Functions

static double hRnd_Startup (float n)
 
static double hRnd_CRT (float n)
 
static double hRnd_QB (float n)
 
static double hRnd_FAST (float n)
 
static double hRnd_MTWIST (float n)
 
FBCALL double fb_Rnd (float n)
 
FBCALL void fb_Randomize (double seed, int algorithm)
 

Variables

static double(* rnd_func )(float) = hRnd_Startup
 
static uint32_t iseed = INITIAL_SEED
 
static uint32_t state [MAX_STATE]
 
static uint32_t * p = NULL
 
static double last_num = 0.0
 

Macro Definition Documentation

#define INITIAL_SEED   327680

Definition at line 19 of file math_rnd.c.

#define MAX_STATE   624

Definition at line 21 of file math_rnd.c.

#define PERIOD   397

Definition at line 22 of file math_rnd.c.

#define RND_AUTO   0

Definition at line 12 of file math_rnd.c.

#define RND_CRT   1

Definition at line 13 of file math_rnd.c.

#define RND_FAST   2

Definition at line 14 of file math_rnd.c.

#define RND_MTWIST   3

Definition at line 15 of file math_rnd.c.

#define RND_QB   4

Definition at line 16 of file math_rnd.c.

#define RND_REAL   5

Definition at line 17 of file math_rnd.c.

Function Documentation

FBCALL void fb_Randomize ( double  seed,
int  algorithm 
)

Definition at line 189 of file math_rnd.c.

Here is the call graph for this function:

Here is the caller graph for this function:

FBCALL double fb_Rnd ( float  n)

Definition at line 183 of file math_rnd.c.

Here is the caller graph for this function:

static double hRnd_CRT ( float  n)
static

Definition at line 50 of file math_rnd.c.

Here is the caller graph for this function:

static double hRnd_FAST ( float  n)
static

Definition at line 59 of file math_rnd.c.

Here is the caller graph for this function:

static double hRnd_MTWIST ( float  n)
static

Definition at line 69 of file math_rnd.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static double hRnd_QB ( float  n)
static

Definition at line 105 of file math_rnd.c.

Here is the caller graph for this function:

static double hRnd_Startup ( float  n)
static

Definition at line 32 of file math_rnd.c.

Here is the call graph for this function:

Variable Documentation

uint32_t iseed = INITIAL_SEED
static

Definition at line 28 of file math_rnd.c.

double last_num = 0.0
static

Definition at line 30 of file math_rnd.c.

uint32_t * p = NULL
static

Definition at line 29 of file math_rnd.c.

double( * rnd_func)(float) = hRnd_Startup
static

Definition at line 27 of file math_rnd.c.

uint32_t state[MAX_STATE]
static

Definition at line 29 of file math_rnd.c.