summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib
diff options
context:
space:
mode:
authorThomas Habets <thomas@habets.se>2020-04-10 11:19:50 +0100
committerMarcus Müller <marcus@hostalia.de>2020-04-10 16:27:57 +0200
commit55b6b2724ae872b36dd93c1479a829bb4054bdda (patch)
tree3c1413dc20cbd28220e8c6b9ec0f5e5e207eb914 /gnuradio-runtime/lib
parent8e777117e10a70a57e138ddbe2144732a3469cfc (diff)
runtime: Make random seed default to current time, as documented
This is what gnuradio currently documents seeding will do, but it's not what C++ defaults to. See C++11 26.5.3.2, paragraph 3. Default for mersenne twister is constexpr 5489. Or easier, the bottom of https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
Diffstat (limited to 'gnuradio-runtime/lib')
-rw-r--r--gnuradio-runtime/lib/math/random.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc
index dc24dbab6f..a25cc1c72e 100644
--- a/gnuradio-runtime/lib/math/random.cc
+++ b/gnuradio-runtime/lib/math/random.cc
@@ -54,7 +54,7 @@ void random::reseed(unsigned int seed)
{
d_seed = seed;
if (d_seed == 0) {
- d_rng.seed();
+ d_rng.seed(time(nullptr));
} else {
d_rng.seed(d_seed);
}