diff options
Diffstat (limited to 'xorshift.c')
| -rw-r--r-- | xorshift.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -22,14 +22,14 @@ __attribute__((visibility("default"))) bool initialize_states(){ errno = EIO; return false; } - global_rng_state.state_idx = global_rng_state.states[7] & 0x0f; + global_rng_state.state_idx = global_rng_state.states[7] >> 28; errno = 0; return true; } __attribute__((visibility("default"))) uint32_t get_random_output(){ size_t use_state = global_rng_state.state_idx; - global_rng_state.state_idx = global_rng_state.states[use_state] & 0x0f; + global_rng_state.state_idx = global_rng_state.states[use_state] >> 28; if ( global_rng_state.gen_period_ctr >= 0xffffffff ){ global_rng_state.period_end_ctr++; if ( global_rng_state.period_end_ctr >= 16 ){ |
