lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> If there are better solutions, I'd be glad to hear them.

function rawBitScanR(num)   -- num can be negative
   return math.floor(math.log(num % 2^32) / math.log(2)) + 1
end