in reply to Most Significant Set Bit

From a strictly Math point of view, that sounds like you want the log base 2 (log2) of the value. So, the log2 of 64, for example, is 6, which means the 6th bit (starting at bit 0) is the MSB. 64, is, of course, 1_000_000 in binary. And you can get that by doing log($value)/log(2):

DB<4> x ( log 64 ) / ( log 2 ) 0 6 DB<5>

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.