| 95 | } |
| 96 | |
| 97 | inline double rk_double(rk_state *state) |
| 98 | { |
| 99 | /* shifts : 67108864 = 0x4000000, 9007199254740992 = 0x20000000000000 */ |
| 100 | long a = rk_random(state) >> 5, b = rk_random(state) >> 6; |
| 101 | return (a * 67108864.0 + b) / 9007199254740992.0; |
| 102 | } |
| 103 | |
| 104 | // Initialise the random generator with the specified seed |
| 105 | void rseed(unsigned long seed) { |