From: "Brian Schröder" Date: 2005-07-30T01:01:13+09:00 Subject: Re: The while loop for calculating a power of a number less than another number? On 29/07/05, Kevin wrote: > 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 > > > I'd think it was a educative example? -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/