From: Matthew Moss Date: 2006-02-09T09:13:18+09:00 Subject: Re: boolean annoyance > > class Something > > def enabled? > > @flags[0x01].nonzero? > > end > > end > > > > I think this is a bad example at it does not what you think it does. > While flags & 0x01 != 0 compares the least significant bit flags[0x01] > does not. You're of by one. It will also not work for multibit checks like > flags & 0x1C. Ooops... Yup, that was wrong given the context.