summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class8
1 files changed, 8 insertions, 0 deletions
diff --git a/it.class b/it.class
index 9ade3a0..0ea9a2f 100644
--- a/it.class
+++ b/it.class
@@ -1061,4 +1061,12 @@ static function sort($array, $mode = "")
return $array;
}
+/**
+ * returns $a modulo $n as a positive number between 0 and $n - 1
+ */
+static function mod($a, $n)
+{
+ return (($a % $n) + $n) % $n;
+}
+
}