diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/l-math.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/l-math.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-math.lua b/Master/texmf-dist/tex/context/base/mkiv/l-math.lua index e5668a5db0a..6105bc3c2d7 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/l-math.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/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 @@ -141,7 +151,7 @@ if not math.ult then local floor = math.floor - function math.tointeger(m,n) + function math.ult(m,n) -- not ok but i'm not motivated to look into it now return floor(m) < floor(n) -- unsigned comparison needed end |