I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » Programming » C/C++ »

john\′s Photo
1 Nov 07, 9:43AM
There are two problem with rand():
  • first is that it isn't a particularly good uniform random generator. You can see this if you generate a large set of numbers and produce a histogram. You should find you have a near straight line, with numbers in all ranges occurring equally.
  • second the repeat period of the rand() isn't as height as some other generators. In otherwords if you try to produce a sufficiently long sequence of random numbers, you eventually reach a point when the sequence is identical to something produced earlier.

There are a couple of alternatives, some of which are on CodeCogs, have a look at this category: http://www.codecogs.com/pages/catgen.php?category=stats/random
Currently you need to be logged in to leave a message.