X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Frand%2FGaloisLFSR.hpp;h=b0714432c77eb20e8cdeff74d6b2ce7dc7220f43;hb=38a4cffc0b6aa58e49d24c06aad7bee14cb6515d;hp=395ff8f0546cc7b75cf111a4b996a7705052f29b;hpb=41652fb3d73f12e6ae4ce7380244a75a4f5c6797;p=blank.git 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 {