From: Elliot Temple Date: 2006-06-04T10:48:02+09:00 Subject: Re: Where can one find examples of masterful Ruby code? On Jun 3, 2006, at 6:17 PM, Ray Baxter wrote: > Alder Green wrote: > >> For example: check if integer i is a power of 2, with an >> expression no >> more than 13 characters long. >> Solution: (i & (i - 1)) > > 0 is a power of 2? 2^negative_infinity add a special case if you like. -- Elliot Temple http://www.curi.us/blog/