I want to check if the number is even! I tried the following:
a = 4.0 a.is_a? Integer => false a.even? => undefined method for Float
S
Make it an Integer then:
Integer
a = 4.0 a.to_i == a && a.to_i.even? #=> true