Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2908

Re: Exclusive float range, Range#step result in counterintuitive result

From Joey Zhou <yimutang@gmail.com>
Newsgroups comp.lang.ruby
Subject Re: Exclusive float range, Range#step result in counterintuitive result
Date Thu, 14 Apr 2011 21:22:48 -0500
Organization Service de news de lacave.net
Lines 16
Message-ID <09dfae08eadbcb7b92531f4dae0e142d@ruby-forum.com> (permalink)
References <a1e005bd5510e4b0931e34c1d6147eaf@ruby-forum.com> <ea9c70684501a99b8ceb08fb50b72503@ruby-forum.com> <E1QAWa1-0003b1-Q5@x61.netlab.jp>
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace talisker.lacave.net 1302834570 26908 65.111.164.187 (15 Apr 2011 02:29:30 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Fri, 15 Apr 2011 02:29:30 +0000 (UTC)
In-Reply-To <E1QAWa1-0003b1-Q5@x61.netlab.jp>
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 381598
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <09dfae08eadbcb7b92531f4dae0e142d@ruby-forum.com>
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!talisker.lacave.net!lacave.net!not-for-mail
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:2908

Show key headers only | View raw


Yukihiro Matsumoto wrote in post #992890:
>
> By definition, floats cannot be used in ranges, when you want to
> iterate over it.
>
>               matz.

But it seems that floats can be used in a range which can be iterated.

int..float is OK, it can call methods from Enumerable module.

But int..float sometimes result in confusion.

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Exclusive float range, Range#step result in counterintuitive result Yukihiro Matsumoto <matz@ruby-lang.org> - 2011-04-14 19:08 -0500
  Re: Exclusive float range, Range#step result in counterintuitive result Joey Zhou <yimutang@gmail.com> - 2011-04-14 21:22 -0500

csiph-web