From 30b3429f0e138c93c5f1ba1d1a6d46728c0943e9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 4 Oct 2022 03:00:59 +0000 Subject: CTAN sync 202210040300 --- macros/luatex/generic/luaotfload/fontloader-l-math.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'macros/luatex/generic/luaotfload/fontloader-l-math.lua') diff --git a/macros/luatex/generic/luaotfload/fontloader-l-math.lua b/macros/luatex/generic/luaotfload/fontloader-l-math.lua index 69f0a19e98..6105bc3c2d 100644 --- a/macros/luatex/generic/luaotfload/fontloader-l-math.lua +++ b/macros/luatex/generic/luaotfload/fontloader-l-math.lua @@ -14,9 +14,19 @@ end if not math.round then - local floor = math.floor + if xmath then + + math.round = xmath.round + + else - function math.round(x) return floor(x + 0.5) end + local floor = math.floor + + function math.round(x) + return x < 0 and -floor(-x + 0.5) or floor(x + 0.5) + end + + end end -- cgit v1.2.3