Cross Platform Rnd() Consistency

Monkey Forums/Monkey Programming/Cross Platform Rnd() Consistency

Raz(Posted 2012) [#1]
I'm guessing probably not but...

Is it possible to create a random generator that behaves exactly the same over many platforms?


muddy_shoes(Posted 2012) [#2]
Yes. Monkey's Rnd should be one. If you're seeing inconsistencies with the standard Monkey one then I'd guess it's due to double/float differences. What problems are you seeing?


Raz(Posted 2012) [#3]
Oh wow... you can probably ignore me, I could've sworn they generated different figures, but they don't!

Oops.


visionastral(Posted 2012) [#4]
mmm... that's interesting and quite useful.


pantson(Posted 2012) [#5]
really?
I wrote my own random number module for this purpose.
oh well ;-)


Raz(Posted 2012) [#6]
I only checked XNA and HTML5 at this time, but ignoring precision (which is fine for me), they generate the same numbers


Gerry Quinn(Posted 2012) [#7]
I have an integer rand() in the code section that clones the version from MSVC.