MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / next_u32

Method next_u32

tools/bloom-reference/src/main.rs:1030–1041  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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 {

Callers 3

newMethod · 0.80
next_f32Method · 0.80
window_resizedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected