I need a "random" number generator, which produces the same result for a given seed on Windows, Mac, Linux, iOS and Android. Now I tried std::rand
and boost::random_int_generator
with boost::mt19937
but sadly the result is different between Windows and Mac.
Does anyone know of a (C++) implementation, that works reliably on all platforms?
EDIT 1:
To be more specific, a diff between numbers from boost::mt19937
on Windows and Mac shows, that on Windows there are (2) additional blocks of numbers being generated. It looks really strange because the majority of numbers is the same with these blocks being only present on Windows.
EDIT 2:
boost::mt19937
works reliably on all platforms. Our problems were not a bug there.
The different numbers resulted in a piece of glm
code we used. They use undetermined order of argument evaluation, which is fine for nearly random purposes, but not when you want deterministic numbers (obviously). So we corrected the code for our purposes and successfully use boost::mt19937
on Windows, Mac, Linux, Android and iOS.
Sorry for the confusion.