From d6a10282daaae2d88ad7b00cd26f1a93fd0450b9 Mon Sep 17 00:00:00 2001 From: arpruss Date: Tue, 3 Nov 2015 09:15:28 -0600 Subject: [PATCH] slowbit32 fix --- raspberryjammod/slowbit32.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raspberryjammod/slowbit32.lua b/raspberryjammod/slowbit32.lua index 145ab74..a227d7d 100644 --- a/raspberryjammod/slowbit32.lua +++ b/raspberryjammod/slowbit32.lua @@ -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