On Wed, 11 Aug 2004 04:26:15 +0900, Daniel Berger <djberg96 / hotmail.com> wrote:
> Ruby 1.8.2 preview 2
> 
> If I have r = Range.new(0,50,true), shouldn't r.end return 49 and
> not 50? I am confused by this.
> 
> If this has come up on the ML in the past, please direct me (and
> others) to the thread - I couldn't find it.


In mathematical range notation, the difference between 0..50 and
0...50 is [0, 50] and [0, 50). Thus:

  irb(main):001:0> a = 0..50
  => 0..50
  irb(main):002:0> b = 0...50
  => 0...50
  irb(main):003:0> a.include?(49)
  => true
  irb(main):004:0> b.include?(49)
  => true
  irb(main):005:0> a.include?(49.9)
  => true
  irb(main):006:0> b.include?(49.9)
  => true
  irb(main):007:0> a.include?(50)
  => true
  irb(main):008:0> b.include?(50)
  => false

-austin
-- 
Austin Ziegler * halostatue / gmail.com
               * Alternate: austin / halostatue.ca