Reply to Re: Need help to custom the rand function ,

Your name:

Reply:


Posted by Betikci Boris on 02/01/08 07:13

On Jan 31, 8:56 pm, Fred <himse...@gmail.com> wrote:
> Hi guys,
>
> I was wondering how could i get a random number exemple between 1 and
> 100 but with n% of getting some value over a number x.
>
> Thanks a lot in advance.
>
> Fred

Here is the code ;)

for($i=1;$i<=100;$i++){
$rnum=rand(1,100);
if($rnum>x)
$bigx++;
else $smallx++;
$count++;
}
$ratio=$bigx/$count;
echo "Ratio of the created random numbers bigger than x is :" .
$ratio;

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация