Brushwood
Saturday, 10 August 2013
Ruby check if even number, float
Ruby check if even number, float
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
So how can i check if the number is even?
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment