This implements @pgimeno's suggestion.
This commit is contained in:
Robin Wellner 2016-05-20 01:03:01 +02:00
parent 356cad7ed5
commit 3bea79546b

View File

@ -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