aboutsummaryrefslogtreecommitdiff
path: root/intmath.c
diff options
context:
space:
mode:
Diffstat (limited to 'intmath.c')
-rw-r--r--intmath.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/intmath.c b/intmath.c
index 5d70860..9e1f3ed 100644
--- a/intmath.c
+++ b/intmath.c
@@ -14,6 +14,15 @@ int int_pown(unsigned int base, unsigned int exp) {
return res;
}
+unsigned long long ull_pown(unsigned int base, unsigned int exp) {
+ unsigned long long res = 1;
+ while (exp > 0) {
+ res *= base;
+ exp--;
+ }
+ return res;
+}
+
int int_pow10(unsigned int exp) {
return int_pown(10, exp);
}