3 ms·
`is-odd` is made by the same developer. This was created to inflate NPM numbers.
by ratww 5y ago
`is-odd` is made by the same developer. This was created to inflate NPM numbers.
- 3pt14159 5y agoThis is what I like about ruby. I search, I find, they have almost no downloads: https://rubygems.org/gems/is_odd/versions/0.1.1 https://rubygems.org/gems/is_odd/versions/0.1.1 https://rubygems.org/gems/is_even/versions/0.1.0 https://rubygems.org/gems/is_even/versions/0.1.0
- rezonant 5y agoIt 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)