case something
when 0...10
puts 'success'
else
puts 'fail'
end
If I enter 9.5, the result will be "successful." As far as I understand ... means that 10 will not be included, so it counts from 0 to 9? What's going on here? Also, a book with this example (I changed it so as not to copy the code), recommended for using exceptional ranges in case statements, is this considered best practice?
source
share