2007-05-18 02:14:26 +02:00
|
|
|
/**
|
|
|
|
* =========================================================================
|
|
|
|
* File : rand.h
|
|
|
|
* Project : 0 A.D.
|
|
|
|
* Description : pseudorandom number generator
|
|
|
|
* =========================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
// license: GPL; see lib/license.txt
|
|
|
|
|
|
|
|
#ifndef INCLUDED_RAND
|
|
|
|
#define INCLUDED_RAND
|
|
|
|
|
|
|
|
/**
|
|
|
|
* return random integer in [min, max).
|
|
|
|
* avoids several common pitfalls; see discussion at
|
|
|
|
* http://www.azillionmonkeys.com/qed/random.html
|
|
|
|
**/
|
2008-06-01 10:25:12 +02:00
|
|
|
LIB_API size_t rand(size_t min_inclusive, size_t max_exclusive);
|
2007-05-18 02:14:26 +02:00
|
|
|
|
|
|
|
#endif // #ifndef INCLUDED_RAND
|