Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > rand(-10..10)

Thread Tools


Schüle Daniel
Posts: n/a

> The Kernel#rand(-5..15) version wouldn't suffer from this problem. It
> would be a good idea to add this to ruby core, because this
> functionality is something, that is needed very often.

yes, this was exactly my point
if we already had Kernel#rand with Range object, people wouldn't
implement their own methods, making scripts shoter and slightly more
portable (regarding copy&paste other code)

Regards, Daniel
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off