Comments on: Ruby Ranges: How Do They Work? http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/ Ruby Programming Tutorials Sat, 07 Jan 2017 19:44:28 +0000 hourly 1 https://wordpress.org/?v=4.6.3 By: Jesus Castello http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/#comment-489 Sat, 25 Jun 2016 02:16:51 +0000 http://www.blackbytes.info/?p=2906#comment-489 I fixed that. Thank you πŸ™‚

]]>
By: Demba Siby http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/#comment-488 Wed, 22 Jun 2016 13:49:52 +0000 http://www.blackbytes.info/?p=2906#comment-488 ‘The reason this returns false is that strings are compared character by character. Since β€œa” comes before β€œc”, the characters that come after the β€œc” don’t matter.’

You mean the reason this returns true?

]]>
By: Hua http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/#comment-487 Thu, 16 Jun 2016 21:19:17 +0000 http://www.blackbytes.info/?p=2906#comment-487 From the source:

We can understand why.

]]>
By: Jesus Castello http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/#comment-486 Wed, 15 Jun 2016 13:54:45 +0000 http://www.blackbytes.info/?p=2906#comment-486 Good question! The answer is probably this bit from the documentation.

“If begin and end are numeric, comparison is done according to the magnitude of the values.”

http://ruby-doc.org/core-2.2.0/Range.html#method-i-include-3F

]]>
By: rivsc http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/#comment-485 Wed, 15 Jun 2016 13:46:11 +0000 http://www.blackbytes.info/?p=2906#comment-485

Why ?

]]>