Implementation of a linear congruential generator Here's a simple LCG that I've made to learn a bit more about pseudo random number generation.

Is this implementation correct, and if so, how can I improve it further?

The following code is self contained and it should run without problems.

#include &lt;chrono&gt;
#include &lt;iostream&gt;
#include &lt;map&gt;

namespace Random {
    class LCG {
        static constexpr uint64_t const A = 0x5851F42D4C957F2D;
        static constexpr uint64_t const C = 0x14057B7EF767814F;
        static constexpr uint64_t const M = 0xFFFFFFFFFFFFFFFF;

        uint64_t this_seed;

        auto now() noexcept {
            using namespace std::chrono;
            auto const output = high_resolution_clock::now();
            return output.time_since_epoch().count();
        }

    public:
        LCG() noexcept
            : this_seed(now()) {
        }

        LCG(uint64_t const value) noexcept
            : this_seed(value) {
        }

        void seed() noexcept {
            this_seed = now();
        }

        void seed(uint64_t const value) noexcept {
            this_seed = value;
        }

        // [0, 2 ^ 64 - 1)
        auto next() noexcept {
            this_seed = (this_seed * A + C) &amp; M;
            return this_seed;
        }

        void discard(uint64_t const amount) noexcept {
            for (uint64_t i = 0; i != amount; ++i) {
                next();
            }
        }

        // [0, 1)
        double get() noexcept {
            return static_cast&lt;double&gt;(next()) / M;
        }

        // x - 0 == (-1 | 0 | 1) ? 0 : x &gt; 0 ? [0, x) : (x, 0]
        int64_t get(int64_t const x) noexcept {
            return static_cast&lt;int64_t&gt;(get() * x);
        }

        // b - a == (-1 | 0 | 1) ? 0 : b &gt; a ? [a, b) : (b, a]
        int64_t get(int64_t const a, int64_t const b) noexcept {
            return a + static_cast&lt;int64_t&gt;(get() * (b - a));
        }
    };
}

int main() {

    Random::LCG lcg(0);
    std::map&lt;int64_t, uint64_t&gt; buckets;
    for (uint64_t i = 0; i != 1000000; ++i) {
        ++buckets[lcg.get(10)];
    }
    for (auto const [a, b] : buckets) {
        std::cout &lt;&lt; a &lt;&lt; '\t' &lt;&lt; b &lt;&lt; '\n';
    }

    return 0;
}
Your mask value M is gaining you nothing, since the types for this_seed and M are the same and you have every bit in M set to 1.  Your comment for next is wrong; it can return 264-1 (i.e., all bits set).  The correct range can be stated as either [0, 2 ^ 64 - 1] or [0, 2 ^ 64).  This in turn can cause your get functions to return a value larger than expected (1.0, x, or b).

Where did you get the values for the A and B constants?  I've not looked to see if they are appropriate.