Re: PHP mt_srand no longer seeds same number!!!!! aaarrrg



A wrote:
Random numbers are exactly that - random (actually, in programming they can only be pseudo-random). Your problem is you are depending on the ability to repeat a sequence. That's not a good assumption to make in any language.

If you need to be able to repeat the sequence, I would suggest you write your own pseudo-random number generator. That way you can control its actions. They aren't too hard, and googling should get you several examples.

true but that just bloats the code for something that should work. seed should start from the same point. yes, i need random numbers but with the same starting point - that's the whole idea. thanks for the answer though.

any other ideas?




It does work. And no, a seed should not start from the same point. Such an operation would not be even pseudo-random.

What you need is not random numbers - you need a sequence, which is something entirely different.

Zend finally corrected the code, and you got caught because you depended on something you shouldn't have.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages