]> git.localhorst.tv Git - blobs.git/blobdiff - src/math/GaloisLFSR.hpp
color mutation
[blobs.git] / src / math / GaloisLFSR.hpp
index d380e248405a2efb1ae9b65308d3b05b48e09e18..e2f39ebb5110eb348ea26f57dcb377933a0ee5e6 100644 (file)
@@ -63,6 +63,10 @@ public:
                return double(Next<std::uint64_t>()) * (1.0 / double(std::numeric_limits<std::uint64_t>::max()));
        }
 
+       unsigned int UInt(unsigned int below) noexcept {
+               return ((unsigned int)(UNorm() * double(below))) % below;
+       }
+
        template<class Container>
        typename Container::reference From(Container &c) {
                assert(c.size() > 0);