From 3bea79546bd6b33a26dd628b7f65673dd902856b Mon Sep 17 00:00:00 2001 From: Robin Wellner Date: Fri, 20 May 2016 01:03:01 +0200 Subject: [PATCH] Resolve #4 This implements @pgimeno's suggestion. --- ser.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ser.lua b/ser.lua index 904094a..0c6cc7b 100644 --- a/ser.lua +++ b/ser.lua @@ -8,7 +8,7 @@ local function make_safe(text) return ("%q"):format(text):gsub('\n', 'n'):gsub("[\128-\255]", getchr) end -local oddvals = {[tostring(1/0)] = '1/0', [tostring(-1/0)] = '-1/0', [tostring(0/0)] = '0/0'} +local oddvals = {[tostring(1/0)] = '1/0', [tostring(-1/0)] = '-1/0', [tostring(-(0/0))] = '-(0/0)', [tostring(0/0)] = '0/0'} local function write(t, memo, rev_memo) local ty = type(t) if ty == 'number' then