|
From: Zodiaq <zo...@ac...> - 2003-03-20 11:31:41
|
Hello Daniel and all Dev-C++ users, Thursday, March 20, 2003, 12:04:44 PM, Daniel wrote as follows: DG> ??? Are you sure? I thought the seed was used to make numbers 'more random'? DG> Can you explain seeding a little bit more? random numbers generated by rand() are generated by this algorithm: -take some number - here where srand() is used -add to "some number" A VERY BIG INT (constant value, I don't know exactly what it is) which generates new number which is bigger than biggest possible int value - when this happens "some number" new value is exactly what is over max_int Each time you use rand() second part is repeated and "some number" value returned... for this algorithm most important is value of "A VERY BIG INT"... there are also some more advanced algorithms in net, but this one is fast and for almost every case just enough - it generated "pseudo random" numbers... -- regards, Zodiaq |