imneme / pcg-c-basic

PCG — Minimal C Implementation
Apache License 2.0
408 stars 51 forks source link

Safe uint64_t extension #15

Open tdegeus opened 3 years ago

tdegeus commented 3 years ago

Thanks a lot for this wonderfully simple code! I just had a question and that is, is there an equally simple way to generate a 64-bit stream?

imneme commented 3 years ago

That's basically what pcg32x2 does, although perhaps it could do it a good deal better.

imneme commented 3 years ago

(Specifically, it would be much better if the two PRNGs tied together used different multiplicative constants, but that would push things further away from being maximally simple.)

imneme commented 3 years ago

You can also check out pcg-c for more options.

tdegeus commented 3 years ago

I see @imneme . Thanks a lot for the clarification. I guess that in order to keep things minimal I will consider living with the 32bit implementation. My purpose is anyway to have to most 'exact' random number.