View Single Post
Re: srand() aberration ???
Old
  (#8)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: srand() aberration ??? - 19-06-2004

rand() is generally considered as a poor random number generator.

You can use this instead, and it generates a 32 bit result instead of 16 bit
Code:
unsigned long idnum;
unsigned long lrand( )
{
   idnum = 1664525L * idnum + 1013904223L;
   return idnum;
}


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote