DNWA/11/wywolania/Data/stide_v1.1/Utils/random.h

14 lines
638 B
C
Raw Normal View History

2021-01-28 18:33:55 +01:00
#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