8 |
|
extern "C" { |
9 |
|
#endif |
10 |
|
|
11 |
– |
#ifdef NORANDOM |
12 |
– |
|
13 |
– |
#undef random |
14 |
– |
#define random() 1073741820 |
15 |
– |
#undef srandom |
16 |
– |
#define srandom(s) (s) |
17 |
– |
#define frandom() 0.5 |
18 |
– |
#define urand(i) 0.5 |
19 |
– |
#define initurand(n) (n) |
20 |
– |
|
21 |
– |
#else |
22 |
– |
|
11 |
|
#ifdef _WIN32 |
12 |
|
|
13 |
|
#if (RAND_MAX <= 65536) |
38 |
|
#endif |
39 |
|
#endif |
40 |
|
|
53 |
– |
#ifdef MC |
54 |
– |
|
55 |
– |
#define urand(i) frandom() |
56 |
– |
#define initurand(n) (n) |
57 |
– |
|
58 |
– |
#else |
59 |
– |
|
41 |
|
extern unsigned short *urperm; |
42 |
|
extern int urmask; |
43 |
|
|
44 |
< |
#define urand(i) ((urperm[(i)&urmask]+frandom())/(urmask+1)) |
44 |
> |
#define urand(i) (urmask ? (urperm[(i)&urmask]+frandom())/(urmask+1) \ |
45 |
> |
: frandom()) |
46 |
|
|
47 |
< |
#endif |
47 |
> |
extern int initurand(int size); |
48 |
|
|
67 |
– |
#endif |
68 |
– |
|
49 |
|
/* defined in urand.c */ |
70 |
– |
extern int initurand(int size); |
50 |
|
extern int ilhash(int *d, int n); |
51 |
|
/* defined in urind.c */ |
52 |
|
extern int urind(int s, int i); |