Is random reliable on all CPUs?
BlitzMax Forums/BlitzMax Programming/Is random reliable on all CPUs?
| ||
Will Rand() and Rnd() work the same on all CPUs and OSs? |
| ||
I know this is not directly answering your question, but Brucey implemented a better random number algorithm in his BaH.Random module for BlitzMax available with the rest of his collection *here*. |
| ||
I don't think you can rely on them to generate the same sequence every time, possibly part of the reason for Brucey creating his version? |
| ||
No they won't. Someone wrote a mersenne twist implementation though, and that should. I think maybe Kanati? EDIT: Yep http://www.blitzbasic.com/Community/posts.php?topic=44228 |
| ||
Thanks. |
| ||
As long you use Randomize() or Seed() at the beginning of your program, it works better than any theory of random numbers. |
| ||
Brucey has a Random module that uses Mersenne twist (I think), which basically duplicates the standard 'random' functions. So you can swap out one module for the other with minimum fuss. That'll give you the same results on every PC. [edit] Just noticed SebHoll's link goes to this. |