(&mut self)
| 1028 | } |
| 1029 | |
| 1030 | fn next_u32(&mut self) -> u32 { |
| 1031 | // xoshiro256-ish mixed with a xorshift — not cryptographically |
| 1032 | // good, but passes statistical tests well enough for Monte |
| 1033 | // Carlo. The constants are the standard PCG multiplier + inc. |
| 1034 | self.state = self |
| 1035 | .state |
| 1036 | .wrapping_mul(6364136223846793005) |
| 1037 | .wrapping_add(1442695040888963407); |
| 1038 | let xorshifted = (((self.state >> 18) ^ self.state) >> 27) as u32; |
| 1039 | let rot = (self.state >> 59) as u32; |
| 1040 | xorshifted.rotate_right(rot) |
| 1041 | } |
| 1042 | |
| 1043 | /// Uniform in [0, 1). |
| 1044 | fn next_f32(&mut self) -> f32 { |
no outgoing calls
no test coverage detected