From: Brent Roman Date: 2005-03-05T04:29:22+09:00 Subject: Re: Integer.odd?/.even? Hi, Well, I'm an old assembly language geek, so... How about this pure-Ruby implementation for odd/even? class Integer def odd self & 1 != 0 end def even self & 1 == 0 end end --- Should be wicked fast. No fancy method calls, division or modulo ops. - brent -- Brent Roman MBARI Software Engineer Tel: (831) 775-1808 7700 Sandholdt Road, Moss Landing, CA 95039 mailto:brent@mbari.org http://www.mbari.org/~brent