From: William James Date: 2006-11-25T20:50:09+09:00 Subject: Re: Shortening this expression ? Robert Klemme wrote: > David Kastrup wrote: > > You realize that "a..b" is the same as "a...b+1"? > > Note: For ints and in this case this is true. However it is not always > true: > > irb(main):008:0> (1.0 .. (10.0+1)).include? 11.0 > => true > irb(main):009:0> (1.0 ... 11.0).include? 11.0 > => false > > :-) > > robert irb(main):004:0> (1.0 .. 10.0).include? 10.5 => false irb(main):005:0> (1.0 ... (10.0+1)).include? 10.5 => true