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 2011-04-14 21:22 -0500
Organization Service de news de lacave.net
Message-ID <09dfae08eadbcb7b92531f4dae0e142d@ruby-forum.com> (permalink)
References <a1e005bd5510e4b0931e34c1d6147eaf@ruby-forum.com> <ea9c70684501a99b8ceb08fb50b72503@ruby-forum.com> <E1QAWa1-0003b1-Q5@x61.netlab.jp>

Show all headers | 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