22static const double theMultFactor = 1.0 / (pow(2, 8 *
sizeof(
unsigned int)) - 1.0);
26 seed[0] = 0xf22d0e56L;
27 seed[1] = 0x883126e9L;
28 seed[2] = 0xc624dd2fL;
30 seed[4] = 0x9e353f7dL;
31 seed[5] = 0x6fdf3b64L;
38 ax += 0x883126e9 - 0xf22d0e56;
40 ax += 0xc624dd2f - 0x883126e9;
42 ax += 0x0702c49c - 0xc624dd2f;
44 ax += 0x9e353f7d - 0x0702c49c;
46 ax += 0x6fdf3b64 - 0x9e353f7d;
51#define ADC(SUM, A, B, C) SUM = (A) + (B) + (C); C = ((SUM < (A)) || (SUM < (B)))
53unsigned int RandClass::randomValue(
void )
59 ADC(ax, seed[5], seed[4], c);
63 ADC(ax, ax, seed[3], c);
66 ADC(ax, ax, seed[2], c);
69 ADC(ax, ax, seed[1], c);
72 ADC(ax, ax, seed[0], c);
99 return (
int)randomValue();
104 unsigned int delta = high - low + 1;
110 rval = ((int)(randomValue()%delta)) + low;
122 double delta = high - low;
128 rval = ((double)(randomValue()) * theMultFactor) * delta + low;
#define ADC(SUM, A, B, C)