29 #include <sys/times.h>
40 #define GET_32_BIT_RAND_YO \
41 basis::un_int ranval = (basis::un_int(rand()) << 16) + (basis::un_int(rand()) << 1) \
42 + (basis::un_int(rand()) % 2)
61 static unsigned int __flaxen = 0;
67 tm *t = localtime(&time_num);
71 printf(
"day %d hour %d min %d sec %d", (
int)t->tm_mday, (
int)t->tm_hour,
72 (
int)t->tm_min, (
int)t->tm_sec);
77 __flaxen = (t->tm_sec + 60 * t->tm_mday + 60 * 31 * t->tm_hour
78 + 24 * 60 * 31 * t->tm_min) ^ add_in_milliseconds;
91 if (high < low)
return low;
92 unsigned int range = high - low + 1;
94 int adjusted = ranval % range + low;
101 if (high < low)
return low + 1;
102 unsigned int range = high - low - 1;
104 int adjusted = ranval % range + low + 1;
#define GET_32_BIT_RAND_YO
static basis::un_int system_uptime()
gives the operating system's uptime in a small form that rolls over.
Root object for any class that knows its own name.
a platform-independent way to acquire random numbers in a specific range.
DEFINE_CLASS_NAME("chaos")
int exclusive(int low, int high) const
< Returns a pseudo-random number r, such that "low" < r < "high".
int inclusive(int low, int high) const
< Returns a pseudo-random number r, such that "low" <= r <= "high".
Constants and objects used throughout HOOPLE.
An extension to floating point primitives providing approximate equality.