slowbit32 fix

This commit is contained in:
arpruss 2015-11-03 09:15:28 -06:00
parent e48603a72f
commit d6a10282da

View File

@ -6,7 +6,7 @@ local two32 = 2^32
local to_binary = function(x)
local pos = two31
local a = ""
if x < 0 then
if x < 0 then
x = x + two32
end
x = x % two32
@ -23,7 +23,7 @@ local to_binary = function(x)
end
local from_binary = function(x)
local z = tonumber(x)
local z = tonumber(x,2)
if z >= two31 then
return z - two32
else