Sep 23, 2022 at 7:54am UTC
Last edited on
Sep 23, 2022 at 8:13am UTC
Sep 23, 2022 at 8:17am UTC
The only check for the params I am trying to make is the lower bound is not greater than upper bound.
The code is not bullet-proof, designed to catch every flavor and nuance of potential misuse. As long as 'a' is less than 'b' I'm happy.
But as I said earlier, your suggestion of >= for std::uniform_real_distribution is well founded and will be implemented. :)
Sep 23, 2022 at 9:48am UTC
Yes, it looks like you're testing correctly.
Wait a minute! It should be (to - from) otherwise you'll get a negative number.
Last edited on
Sep 23, 2022 at 9:50am UTC
Sep 23, 2022 at 10:08am UTC
Heh, as I said I needed a fresh pairs of eyes on this, and dammit I was correct. (from - to) looked correct.
cppreference has it as b-a. :|
Gi'e me a few minutes to correct my "correction" and update the github repo. I wanna be able to call this omelet done.
Sep 23, 2022 at 10:16am UTC
Admittedly this RTK isn't cryptographically robust, but that isn't the stated intent. I want to have something that makes using the <random> library as easy as using the C library functions. Either as a stand-alone header or module interface file.
Sep 23, 2022 at 10:37am UTC
I realize what a and b represent, really. :) I simply made a
hooman mistake of long hours staring at code and lots of bad coffee.
Sep 26, 2022 at 8:27pm UTC
Good coffee is just wasted on this Pleb and villein.