1 /*-------------------------------------------------------------------------
4 * random number generator
6 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 *-------------------------------------------------------------------------
15 =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
16 * Martin Utesch * Institute of Automatic Control *
17 = = University of Mining and Technology =
18 * utesch@aut.tu-freiberg.de * Freiberg, Germany *
19 =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
22 /* -- parts of this are adapted from D. Whitley's Genitor algorithm -- */
29 /* geqo_rand returns a random float value between 0 and 1 inclusive */
31 #define geqo_rand() ((double) random() / (double) MAX_RANDOM_VALUE)
33 /* geqo_randint returns integer value between lower and upper inclusive */
35 #define geqo_randint(upper,lower) \
36 ( (int) floor( geqo_rand()*(((upper)-(lower))+0.999999) ) + (lower) )
38 #endif /* GEQO_RANDOM_H */