From: Kevin Date: 2005-07-30T00:51:02+09:00 Subject: Re: The while loop for calculating a power of a number less than another number? this is odd since you don't need to loop to find the answer maxnum = 10_000 n = 2 ** (Math.log(maxnum) / Math.log(2)).floor puts n + " is the largest power of 2 less than " + maxnum