How is 6 <= 10?


Please I don't understand how 6 is less or equals to 10 ?
I wrote this code :

in the console .. what I know that 6 is less than 10 it can't be equal.. what's wrong ?

a = 6
b = 10
if a <= b
    puts "a less or equals to b"
elsif a == b
  puts "a equals b"
    " a is not less or equals , also not equals if you see this line"

and I got: 
 a less or equals to b


Less than or equal to is an inequality expression that includes all integers less than 11. We are not saying the 6 is equal to 10, but less than 10.


If the number is undetermined, <= or >= would suffice as we wouldn't know if it's less than or equal to. It works the same here except that the number is determined, so it would be less than. I works, like mtf said, for integers under 11.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.