more changes

This commit is contained in:
2026-08-17 21:15:56 -06:00
parent 22b86a602f
commit 0cb555254c
5 changed files with 78 additions and 34 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "util.hpp"
namespace bigmath {
u64 ipow(u64 b, u64 p) {
// FROM stack overflow
// "The most efficient way to implement [int pow]"
u64 r = 1;
for(;;) {
if(p & 1) r *= b;
p >>= 1;
if(!p) break;
b *= b;
}
return r;
}
}
+15
View File
@@ -0,0 +1,15 @@
#pragma once
#include <bigmath/BigMath.hpp>
namespace bigmath {
template<typename T>
struct div_result {
T quot;
T remain;
};
u64 ipow(u64 b, u64 p);
}