note 89140 deleted from function.mt-rand by danbrown

From: Date: Tue, 24 Feb 2009 03:48:08 +0000
Subject: note 89140 deleted from function.mt-rand by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151042@lists.php.net to get a copy of this message
Note Submitter: nimphious at syntheticsanity dot com Reason: bad code ---- This will give a psuedo-random value between 0.00000 and 1.00000, though I must wonder if there's a better way of moving the decimal point than using math, sucking up valuable cpu real-estate. <?php function rand_decimal(precision) { return rand(0, 10 ^ precision) / 10 ^ precision; } ?>

« previous php.notes (#151042) next »