3 ms·
It is built into Ruby. 2.7.3 :003 > 1.odd? => true 2.7.3 :004 > 2.odd? => false 2.7.3 :005 > 1.even? => false 2.7.3 :006 > 2.eve
by rezonant 5y ago
It is built into Ruby.
2.7.3 :003 > 1.odd?
=> true
2.7.3 :004 > 2.odd?
=> false
2.7.3 :005 > 1.even?
=> false
2.7.3 :006 > 2.even?
=> true
2.7.3 :007 >
- 3pt14159 5y agoThat's amazing. Do you know since when? I've been doing Python development for a while.
- rezonant 5y agoAt least since 1.8.7 (released May 31, 2008) EDIT: Confirmed, it was added in 1.8.7 according to Ruby Docs [1] [2] [1] https://ruby-doc.org/core-1.8.7/Integer.html https://ruby-doc.org/core-1.8.7/Integer.html (present) [2] https://ruby-doc.org/core-1.8.6/Integer.html https://ruby-doc.org/core-1.8.6/Integer.html (not present)