Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double randomDouble2( double low_bound, double high_bound )
- {
- static bool didSeeding = false;
- if (low_bound > high_bound){
- std::swap(low_bound, high_bound);
- }
- if (!didSeeding) {
- std::mt19937 engine;
- didSeeding = true;
- }
- return std::uniform_real_distribution<>( low_bound, high_bound )( engine );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement