about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/chamath.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/chamath.nim b/src/utils/chamath.nim
new file mode 100644
index 00000000..579b7b69
--- /dev/null
+++ b/src/utils/chamath.nim
@@ -0,0 +1,4 @@
+func absSub*(a, b: SomeUnsignedInt): auto {.inline.} =
+  if a > b:
+    return a - b
+  return b - a