aboutsummaryrefslogtreecommitdiff
path: root/intmath.c
diff options
context:
space:
mode:
authorJoel Kronqvist <joelkronqvist@proton.me>2024-04-07 13:31:07 +0300
committerJoel Kronqvist <joelkronqvist@proton.me>2024-04-07 13:41:46 +0300
commit4ff6a08d73f0ef1e2fcb7a93a74cc6fa66c24e2b (patch)
tree40694627aac44a3f1eb52293b830337b81af69fb /intmath.c
parentf975594e55bdc05ee436bc7bdcd6e09aec5357b1 (diff)
downloadstdu-4ff6a08d73f0ef1e2fcb7a93a74cc6fa66c24e2b.tar.gz
stdu-4ff6a08d73f0ef1e2fcb7a93a74cc6fa66c24e2b.zip
Bigger `bytes_read` & removed redundant code handling impossible signed `bytes_read`
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);
}