Skip to content

Commit

Permalink
fixup! b1a2b14
Browse files Browse the repository at this point in the history
KTL's suggestion for setting the seed while not changing the meaning (much).
  • Loading branch information
PaulPrice committed Jan 23, 2018
1 parent be7431d commit 8b0cf77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/math/Random.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void Random::initialize() {
}
// This seed is guaranteed to be non-zero.
// We want to give a non-zero seed to GSL to avoid it choosing its own.
unsigned int useSeed = _seed % (std::numeric_limits<unsigned long>::max() - 1) + 1;
unsigned long int useSeed = _seed == 0 ? std::numeric_limits<unsigned long int>::max() : _seed;
::gsl_rng_set(rng, useSeed);
_rng.reset(rng, ::gsl_rng_free);
}
Expand Down

0 comments on commit 8b0cf77

Please sign in to comment.