From: Thomas Preymesser Date: 2008-12-24T04:51:56+09:00 Subject: Re: Integer.step is inclusive?! 2008/12/23 Just Another Victim of the Ambient Morality : > I don't know how to post the output of irb so I'll just have to describe > it but if I run the following code: > > 0.upto(10){ |i| puts i } > > ...I will get 11 lines of output. This iterates eleven times. Really?! because this are eleven numbers: 0 1 2 3 4 5 6 7 8 9 10 > Why it does this is obvious. Integer.upto is inclusive so it includes > both 0 and 10. However, am I the only one who thinks this is strange > behaviour? why do you think a loop from 0 to 10 should exclude the upper border? In Ada it is 'for i in 0 .. 10 loop' which is a loop from 0 to 10. -Thomas -- Thomas Preymesser thopre@gmail.com http://thopre.googlepages.com/ http://thopre.wordpress.com/