aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-09-04 12:25:32 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commit1245f019ae70427d1c504b0a0cdfa442905ef136 (patch)
tree1a69c5d84172360ca391ae05059043f27bec3794
parentupdate scm rockspec (diff)
downloadalive-1245f019ae70427d1c504b0a0cdfa442905ef136.tar.gz
alive-1245f019ae70427d1c504b0a0cdfa442905ef136.zip
add math/inc and math/dec ops
-rw-r--r--alv-lib/math.moon5
1 files changed, 5 insertions, 0 deletions
diff --git a/alv-lib/math.moon b/alv-lib/math.moon
index a63f124..7f76ce9 100644
--- a/alv-lib/math.moon
+++ b/alv-lib/math.moon
@@ -132,6 +132,9 @@ max = Constant.meta
description: "Return the highest of arguments."
value: func_op math.max, num*0
+inc = func_def 'inc', 'i', ((i) -> i + 1), "Increment by 1."
+dec = func_def 'dec', 'i', ((i) -> i - 1), "Decrement by 1."
+
cos = func_def 'cos', 'alpha', math.cos, "Cosine function (radians)."
sin = func_def 'sin', 'alpha', math.sin, "Sine function (radians)."
tan = func_def 'tan', 'alpha', math.tan, "Tangent function (radians)."
@@ -170,6 +173,8 @@ Constant.meta
:mix
:min, :max
+ :inc, :dec
+
pi: Constant.meta
value: math.pi
meta: summary: 'The pi constant.'