note 89140 added to function.mt-rand

From: Date: Tue, 24 Feb 2009 03:43:39 +0000
Subject: note 89140 added to function.mt-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-151041@lists.php.net to get a copy of this message
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; } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 203.49.148.200 (proxied: 140.1.35.12) ---- Manual Page -- http://www.php.net/manual/en/function.mt-rand.php Edit -- https://master.php.net/note/edit/89140 Del: integrated -- https://master.php.net/note/delete/89140/integrated Del: useless -- https://master.php.net/note/delete/89140/useless Del: bad code -- https://master.php.net/note/delete/89140/bad+code Del: spam -- https://master.php.net/note/delete/89140/spam Del: non-english -- https://master.php.net/note/delete/89140/non-english Del: in docs -- https://master.php.net/note/delete/89140/in+docs Del: other reasons-- https://master.php.net/note/delete/89140 Reject -- https://master.php.net/note/reject/89140 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151041) next »