diff options
| author | stderr64 <stderr64@null.net> | 2026-09-24 21:41:53 +0300 |
|---|---|---|
| committer | stderr64 <stderr64@null.net> | 2026-09-24 21:41:53 +0300 |
| commit | 9c3a0e5eb91141ce145cecded932b2eadda299d7 (patch) | |
| tree | b6e880b8c62f008b9e578cfd9238369fa4c7bf89 /xorshift.c | |
| parent | f9a30793a176523990415ef0be47dbd1296ab5cc (diff) | |
| download | libxorshift-9c3a0e5eb91141ce145cecded932b2eadda299d7.tar.gz libxorshift-9c3a0e5eb91141ce145cecded932b2eadda299d7.tar.zst | |
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 ){ |
