power_play/src/rand.h
2025-02-28 15:27:02 -06:00

17 lines
453 B
C

#ifndef RAND_H
#define RAND_H
struct rand_state {
/* If a state's seed == 0 upon a call to a related function, it will be initialized using platform's true rng source */
u64 seed;
u64 counter;
};
u64 rand_u64_from_state(struct rand_state *state);
f64 rand_f64_from_state(struct rand_state *state, f64 range_start, f64 range_end);
u64 rand_u64_from_seed(u64 seed);
f64 rand_f64_from_seed(u64 seed, f64 range_start, f64 range_end);
#endif