[linux] Re: PERL - RNG

Juraj Variny jv99737 na decef.elf.stuba.sk
Sobota Leden 10 21:43:06 CET 2004


Toto je z man perlfunc ktory mas urcite nainstalovany:

       rand    Returns a random fractional number greater than or equal to 0
               and less than the value of EXPR.  (EXPR should be positive.)
               If EXPR is omitted, the value 1 is used.  Currently EXPR with
               the value 0 is also special-cased as 1 - this has not been doc-
               umented before perl 5.8.0 and is subject to change in future
               versions of perl.  Automatically calls "srand" unless "srand"
               has already been called.  See also "srand".

               Apply "int()" to the value returned by "rand()" if you want
               random integers instead of random fractional numbers.  For
               example,

                   int(rand(10))

               returns a random integer between 0 and 9, inclusive.

On Saturday 10 January 2004 19:32, Remenec Juraj wrote:
> Zdravim.
> Prosim vas, nemam momentalne k dispozicii dokumentaciu:
> Mozte mi niekto napisat ako docielit v PERLe, aby sa mi do
> premennej $random - zapisalo nejake nahodne cislo v rozmedzi od 1-10 ???
>
> Vdaka moc.
>
> J.
>
>
> _______________________________________________
> http://lists.linux.sk/listinfo/linux
> Prehladavanie archivu: http://search.lists.linux.sk
> Meta FAQ: http://faq.lists.linux.sk




Další informace o konferenci linux