note 26145 deleted from function.rand by nlopess

From: Date: Sat, 03 Jan 2004 16:40:03 +0000
Subject: note 26145 deleted from function.rand by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62871@lists.php.net to get a copy of this message
Note Submitter: cccc_nl@hotmail.com ---- rand() seems to return only integers, since I used rand(0.8, 1.2) * $a_variable; and the result was 0. In case you are having the same problem, the simple solution is this: // Create a number between 0.85 and 1.12 $r = (rand(85, 112) / 100);

« previous php.notes (#62871) next »