55 #define TAK_MAK_INIT_LONG_1 19650218UL 56 #define TAK_MAK_INIT_LONG_2 5489UL 61 #define TAK_MAK_MATRIX_A 0x9908b0dfUL 62 #define TAK_MAK_UPPER_MASK 0x80000000UL 63 #define TAK_MAK_LOWER_MASK 0x7fffffffUL 66 long to_interval(
long val,
long min,
long max){
67 long diff = 0, resp = 0;
72 long rr = (val % diff);
73 if(rr < 0){ rr = -rr; }
80 unsigned long mt[TAK_MAK_N];
84 tak_mak(
unsigned long ini_val = 0){
87 ini_val = TAK_MAK_INIT_LONG_1;
89 init_with_long(ini_val);
92 tak_mak(
const unsigned long* init_key,
int key_length){
94 init_with_array(init_key, key_length);
101 void init_with_long(
unsigned long s);
102 void init_with_array(
const unsigned long* init_key,
int key_length);
104 unsigned long gen_rand_int32(
void);
106 double gen_rand_i0_i1(
void);
107 double gen_rand_i0_e1(
void);
108 double gen_rand_e0_e1(
void);
110 long gen_rand_int32_ie(
long min,
long max){
111 return to_interval(gen_rand_int32(), min, max);