Search code examples
silverlightrandomplatform-specific

Silverlight System.Random sequencing cross platform


I need to know the effect of different platforms on the System.Random object (Silverlight). Is the sequence created the same on Mac, PC and across 32 / 64 bit?


Solution

  • The algorithm to generate the random numbers is encoded into the runtime. Hence regardless of the platform you should see the same set of "random" numbers for a given seed value.

    The extact behaviour of default constructor for Random (where the seed value is time based) may vary slightly from platform to platform. For example rapid creation of instances of Random may create some instances that generate the same sequence, the distribution of these "duplicates" may vary on all sorts of conditions including the platform.