With ranges in Ruby, you can do 0..5to include all numbers between 0 and 5. In addition, you can do 0...5to include the same numbers except 5, not included.
(1..5) === 5
=> true
(1...5) === 5
=> false
(1...5) === 4.999999
=> true
Is there a way to exclude the first number instead of the last to get such a result?
(1...5) === 1
=> false
(1...5) === 1.00000001
=> true
source
share