aboutsummaryrefslogtreecommitdiffstats
path: root/lib/math.moon
diff options
context:
space:
mode:
Diffstat (limited to 'lib/math.moon')
-rw-r--r--lib/math.moon3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/math.moon b/lib/math.moon
index 35ee4de..54d3440 100644
--- a/lib/math.moon
+++ b/lib/math.moon
@@ -75,11 +75,14 @@ func_op = (name, arity, func) ->
k.__name = name
k
+mod = func_op 'mod', 2, (a, b) -> a % b
+
module = {
:add, '+': add
:sub, '-': sub
:mul, '*': mul
:div, '/': div
+ :mod, '%': mod
mix: func_op 'mix', 3, (a, b, i) -> i*b + (1-i)*a