Re: PHP mt_srand no longer seeds same number!!!!! aaarrrg
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Thu, 11 Sep 2008 23:36:35 -0400
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
==================
.
- References:
- Prev by Date: Re: function definition error
- Next by Date: Re: function definition error
- Previous by thread: Re: PHP mt_srand no longer seeds same number!!!!! aaarrrg
- Next by thread: Re: PHP mt_srand no longer seeds same number!!!!! aaarrrg
- Index(es):
Relevant Pages
|