@@ -79,6 +79,30 @@ u64 wpPrngXorshift256p(WpXor256State *state) {
|
||||
return result;
|
||||
}
|
||||
|
||||
u64 wpPrngXorshift256InRange(WpXor256State *state, u64 start, u64 end) {
|
||||
return wpPrngXorshift256(state) % (end - start) + start;
|
||||
}
|
||||
|
||||
u64 wpPrngXorshift256ssInRange(WpXor256State *state, u64 start, u64 end) {
|
||||
return wpPrngXorshift256ss(state) % (end - start) + start;
|
||||
}
|
||||
|
||||
u64 wpPrngXorshift256pInRange(WpXor256State *state, u64 start, u64 end) {
|
||||
return wpPrngXorshift256p(state) % (end - start) + start;
|
||||
}
|
||||
|
||||
u64 wpPrngXorshift256Choice(WpXor256State *state, u64 available_choices) {
|
||||
return wpPrngXorshift256(state) % available_choices;
|
||||
}
|
||||
|
||||
u64 wpPrngXorshift256ssChoice(WpXor256State *state, u64 available_choices) {
|
||||
return wpPrngXorshift256ss(state) % available_choices;
|
||||
}
|
||||
|
||||
u64 wpPrngXorshift256pChoice(WpXor256State *state, u64 available_choices) {
|
||||
return wpPrngXorshift256p(state) % available_choices;
|
||||
}
|
||||
|
||||
wp_intern u64 split_mix_64(SplitMix64State *state) {
|
||||
state->seed += 0x9E3779B97f4A7C15;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user