From: Robert Klemme Date: 2006-05-10T16:01:07+09:00 Subject: Re: Exponential calcs with very large exponents 2006/5/10, Sergey Volkov : > Btw: do you know how to find most significant bit faster? Dunno whether any of these is faster >> require 'mathn' => true >> x=1<<40 => 1099511627776 >> k=("%b" % x).length - 1 => 40 >> x[k] => 1 >> k=Math.log(x)/Math.log(2) => 40.0 >> x[k] => 1 Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/