summaryrefslogtreecommitdiff
path: root/numutil.lua
diff options
context:
space:
mode:
Diffstat (limited to 'numutil.lua')
-rw-r--r--numutil.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/numutil.lua b/numutil.lua
new file mode 100644
index 0000000..ce212c4
--- /dev/null
+++ b/numutil.lua
@@ -0,0 +1,11 @@
+local function sign(x)
+ if x > 0 then return 1
+ elseif x < 0 then return -1
+ else return 0
+ end
+end
+
+
+return {
+ sign = sign,
+}