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


Groups > comp.lang.ruby > #2895 > unrolled thread

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

Started byYukihiro Matsumoto <matz@ruby-lang.org>
First post2011-04-14 19:08 -0500
Last post2011-04-14 21:22 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.ruby


Contents

  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

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

FromYukihiro Matsumoto <matz@ruby-lang.org>
Date2011-04-14 19:08 -0500
SubjectRe: Exclusive float range, Range#step result in counterintuitive result
Message-ID<E1QAWa1-0003b1-Q5@x61.netlab.jp>
Hi,

In message "Re: Exclusive float range, Range#step result in counterintuitive result"
    on Fri, 15 Apr 2011 01:47:03 +0900, 7stud -- <bbxx789_05ss@yahoo.com> writes:
|
|Joey Zhou wrote in post #992758:
|>
|> The results seem so counterintuitive, is it a bug? Maybe I should report
|> it?
|
|By definition, floats cannot be used in ranges.

By definition, floats cannot be used in ranges, when you want to
iterate over it.

							matz.

[toc] | [next] | [standalone]


#2908

FromJoey Zhou <yimutang@gmail.com>
Date2011-04-14 21:22 -0500
Message-ID<09dfae08eadbcb7b92531f4dae0e142d@ruby-forum.com>
In reply to#2895
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/.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web