lua-users home
lua-l archive

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


I'm running LUA v5.3.2. In the code below shouldn't the following if statements produce the same results?

-----code below here------

local tracemask = 0x00000040
local traceflgs = 0

val = traceflgs & tracemask

if (traceflgs & tracemask) then
    print("val=" .. val .. "\n")
else
    print("Branch not taken...\n")
end

if ((traceflgs & tracemask) > 0) then
    print("val=" .. val .. "\n")
else
    print("Branch not taken...\n")
end