… | |
… | |
97 | diff = max - min + 1; |
97 | diff = max - min + 1; |
98 | ((diff > 2) ? (base = 20) : (base = 50)); /* d2 and d3 are corner cases */ |
98 | ((diff > 2) ? (base = 20) : (base = 50)); /* d2 and d3 are corner cases */ |
99 | |
99 | |
100 | if (max < 1 || diff < 1) |
100 | if (max < 1 || diff < 1) |
101 | { |
101 | { |
102 | LOG (llevError, "Calling random_roll with min=%" I64_PFd " max=%" I64_PFd "\n", min, max); |
102 | LOG (llevError, "Calling random_roll with min=%" PRId64 " max=%" PRId64 "\n", min, max); |
103 | return (min); /* avoids a float exception */ |
103 | return (min); /* avoids a float exception */ |
104 | } |
104 | } |
105 | |
105 | |
106 | /* Don't know of a portable call to get 64 bit random values. |
106 | /* Don't know of a portable call to get 64 bit random values. |
107 | * So make a call to get two 32 bit random numbers, and just to |
107 | * So make a call to get two 32 bit random numbers, and just to |