lua-users home
lua-l archive

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


I found new strangeness:

math.floor(math.log(2^n, 2)^a)) --> n^a - 1



2014-03-04 15:43 GMT+04:00 Dio Darkclainer <darkclainer@gmail.com>:
Hello all!
Code:

for i=1,20 do
   if math.floor(math.log(2^i,2)) ~= i then
      print(i)
   end
end

will be output
3
6
12
13

if use math.log(2^i)/math.log(2) intstead all work correctly
lua 5.2.3