Forum: Ruby Re: Range#size

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-04-13 16:36
(Received via mailing list)
>
> def test_range_size
> 	assert_equal 1, (1..1).size
> 	assert_equal 2, (1..2).size
> 	assert_equal 3, (1..3).size
> 	assert_equal 0, (1..1).size
> 	assert_equal 1, (1...2).size
> end
>
> what do you think?
> -- henon

What's the size of 1.2..3.4?

Regards,

Dan
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-04-13 16:42
(Received via mailing list)
On Thu, 13 Apr 2006, Berger, Daniel wrote:

> What's the size of 1.2..3.4?

5 ?

;-)

-a
This topic is locked and can not be replied to.