blob: 00b72dba5113d51539a0f661c7e177437a6c78d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
-- filename : l-math.lua
-- comment : split off from luat-lib
-- author : Hans Hagen, PRAGMA-ADE, Hasselt NL
-- copyright: PRAGMA ADE / ConTeXt Development Team
-- license : see context related readme files
if not versions then versions = { } end versions['l-math'] = 1.001
local floor = math.floor
if not math.round then
function math.round(x)
return floor(x + 0.5)
end
end
if not math.div then
function math.div(n,m)
return floor(n/m)
end
end
if not math.mod then
function math.mod(n,m)
return n % m
end
end
|