commit 22558eb56b860f1c8bf5a7acf6119edf110d2c26 parent 46b1ec5887a1f8529d856be9cabb7f2e1a2e283e Author: Michael Savage <mikejsavage@gmail.com> Date: Wed Aug 31 09:52:10 -0700 Add rng_next_u64 Diffstat:
rng/rng_utils.h | | | 5 | +++++ |
diff --git a/rng/rng_utils.h b/rng/rng_utils.h @@ -69,4 +69,9 @@ u32 rng_uniform( T * rng, u32 lower_bound, u32 upper_bound ) { return rng_uniform( rng, upper_bound - lower_bound ) + lower_bound; } +template< typename T > +u64 rng_next_u64( T * rng ) { + return ( u64( rng_next( rng ) ) << u64( 31 ) ) | rng_next( rng ); +} + #endif // _RNG_UTILS_H_