Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMarkS

Posted 05 November 2012 - 12:59 AM

I have run into issues with the random number generator that did require calling srand again, but that is rare. Since it is a pseudo-random number generator, patterns can emerge that may be undesirable. If that happens, calling srand will resolve the issue. Chances are you'll never run into such an issue. That being said, alvaro is correct; srand should not be called every time rand is called.

[edit]
I should note that the RNG I was using at the time was limited to 16-bit signed integers.

#2MarkS

Posted 05 November 2012 - 12:49 AM

I have run into issues with the random number generator that did require calling srand again, but that is rare. Since it is a pseudo-random number generator, patterns can emerge that may be undesirable. If that happens, calling srand will resolve the issue. Chances are you'll never run into such an issue. That being said, alvaro is correct; srand should not be called every time rand is called.

#1MarkS

Posted 05 November 2012 - 12:36 AM

I have run into issues with the random number generator that did require calling srand again, but that is rare. Since it is a pseudo-random number generator, patterns can emerge that may be undesirable. If that happens, calling srand will resolve the issue. Chances are you'll never run into such an issue. That being said, alvaro is correct; It should not be called every time rand is called.

PARTNERS