From: Daniel Karbach Date: Tue, 8 Sep 2015 14:01:08 +0000 (+0200) Subject: fix special case in rng X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=bb83e2c9db0fc9746eb076a0ecbd5c64f899d7eb;p=blank.git fix special case in rng --- diff --git a/src/rand/GaloisLFSR.hpp b/src/rand/GaloisLFSR.hpp index 395ff8f..b071443 100644 --- a/src/rand/GaloisLFSR.hpp +++ b/src/rand/GaloisLFSR.hpp @@ -12,7 +12,11 @@ class GaloisLFSR { public: // seed should be non-zero explicit GaloisLFSR(std::uint64_t seed) noexcept - : state(seed) { } + : state(seed) { + if (state == 0) { + state = 1; + } + } // get the next bit bool operator ()() noexcept {