DNWA/11/wywolania/Data/stide_v1.1/Utils/random.h
Jakub Stefko ab1d7e2546 ...
2021-01-28 18:33:55 +01:00

14 lines
638 B
C
Executable File

#ifndef __RANDOM_H
#define __RANDOM_H
/* these are routines to generate random nos in commonly used formats. These routines all
use the random function and so are very random !
*/
void InitRandom(int seed); /* initializes the random system to seed - uses internal state buffers*/
int Probability(float pfactor); /* returns 1 if a random toss is within pfactor, 0 otherwise*/
unsigned Random(unsigned num); /* returns an unsigned from 0 to num-1*/
float Random1(void); /* returns a random floating pt between 0 and 1, i.e over interval (0,1)*/
#endif