Comparision in Ruby | SoloLearn: Learn to code for FREE!

0

Comparision in Ruby

In second quiz regarding comparison of greater / less than, there was quiz question about 7>7.0 Can anyone explain the logic?

11/10/2016 10:46:18 AM

Sulaiman Dawood

2 Answers

New Answer

+2

7 > 7.0 is false, because 7 and 7.0 are equal.

0

So in terms of logical expression it would be 7 ==7.0 which is true and not truthy,right?