viffy 0.1.5

SoA + SIMD automata generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Common dumb xorshift32 randomizer
#[derive(Default, Clone, Copy, Debug)]
pub struct Prng(pub u16);
impl Prng {
	pub fn get_random(mut v: u32) -> u32 {
		v ^= v << 13;
		v ^= v >> 17;
		v ^= v << 5;
		v
	}
	pub fn get_random_norm(v: u32) -> f32 {
		(v & 0xffff) as f32 / 65536.0
	}
}