note 75763 added to function.mt-srand

From: Date: Thu, 14 Jun 2007 17:25:53 +0000
Subject: note 75763 added to function.mt-srand
Groups: php.notes 
Request: Send a blank email to php-notes+get-127484@lists.php.net to get a copy of this message
To slonmron: Seed for random numbers generator should be initialized only once, before calling proper rand function. After that you give pseudorandom sequence by multiple calling rand. Initialization of random seed is used if 1) You have better source of random seed than implemented algorithm or 2) if You need always the same sequence of pseudorandom numbers. Example given by You shows only that first rand result strongly depends on seed, what is by definition. It is not a bug. ---- Server IP: 212.24.129.51 Probable Submitter: 213.220.192.17 ---- Manual Page -- http://www.php.net/manual/en/function.mt-srand.php Edit -- https://master.php.net/note/edit/75763 Del: integrated -- https://master.php.net/note/delete/75763/integrated Del: useless -- https://master.php.net/note/delete/75763/useless Del: bad code -- https://master.php.net/note/delete/75763/bad+code Del: spam -- https://master.php.net/note/delete/75763/spam Del: non-english -- https://master.php.net/note/delete/75763/non-english Del: in docs -- https://master.php.net/note/delete/75763/in+docs Del: other reasons-- https://master.php.net/note/delete/75763 Reject -- https://master.php.net/note/reject/75763 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#127484) next »