From 5305cb34c8285712e00d3be0ba8241015f7a3a1e Mon Sep 17 00:00:00 2001 From: rxi Date: Mon, 12 Jan 2015 19:51:24 +0000 Subject: [PATCH] Lua 5.3 compatibility fixes --- lume.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lume.lua b/lume.lua index 54e8eec..f89684e 100644 --- a/lume.lua +++ b/lume.lua @@ -16,7 +16,7 @@ local math_floor = math.floor local math_ceil = math.ceil local math_random = math.random local math_cos = math.cos -local math_atan2 = math.atan2 +local math_atan2 = math.atan2 or math.atan local math_sqrt = math.sqrt local math_abs = math.abs local math_pi = math.pi @@ -520,7 +520,9 @@ function lume.trace(...) local t = { "[" .. info.short_src .. ":" .. info.currentline .. "]" } for i = 1, select("#", ...) do local x = select(i, ...) - x = (type(x) == "number") and lume.round(x, .01) or (x or "nil") + if type(x) == "number" then + x = string.format("%g", lume.round(x, .01)) + end t[#t + 1] = tostring(x) end print(table.concat(t, " "))