From: Jeffrey Schwab Date: 2006-10-26T10:35:11+09:00 Subject: Re: simple math question Paul Lutus wrote: > Brad Tilley wrote: > >> Thanks for all the examples guys! Being Ruby, I thought there might be >> some super simple method that just magically did this. I'll stick with >> the old-fashioned modulo test. > > If speed matters, the modulo test is way slower than testing the LSB. Do you mean on a specific architecture, or is there a Ruby-specific reason for one to be slower than the other?