lua-users home
lua-l archive

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




On 7 January 2011 14:41, Leo Razoumov <slonik.az@gmail.com> wrote:
Hi List,
In Lua-5.1.4 macro

#define ceillog2(x)     (luaO_log2((x)-1) + 1)

gives wrong answer when x is 0.
ceillog2(0) => 32 (should be 1).


Unless my maths fails me isn't log2(0) infinity or undefined? 
Liam