Afficher un message
Vieux 15/09/2007, 15h51   #1
Austin Ziegler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: will we have rand(m, n)?

On 9/15/07, kendear <summercoolness@gmail.com> wrote:
> given the ease of using Ruby, I wonder whether we will have rand(m, n) in
> the future...
>
> right now, we need to use rand(range) + start
>
> and it can cause a bug that can otherwise be avoided if we have rand(m, n)
> for the clarity.


Why not instead suggest rand(m..n)? That would, I think, be more
readable than rand(m, n).

-austin
--
Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/
* austin@halostatue.ca * http://www.halostatue.ca/feed/
* austin@zieglers.ca

  Réponse avec citation
 
Page generated in 0,20031 seconds with 9 queries