Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rand() limitations?

Status
Not open for further replies.

VincentP

Programmer
Apr 1, 2001
116
Hi,

Does any of you know how many different sequences one can get by changing the seed of rand(). Since srand takes an unsigned int as its argument, I guess this means only 65000 sequences... does anyone know of an algorithm which can generate more sequences? (Say of the order of a "long" type? I'd like at least millions of sequences...)

Vincent
 
as you see is long, but long (4 bytes) can give you one of more than 1000*4mln numbers. Ion Filipski
1c.bmp


filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top