uint64_t binmul(uint64_t a, uint64 b){
uint64_t res = 0;
while(b > 0){
if(b & 1)
res = res + a;
a = 2 * a;
b>>=1;
}
return res;
}
Would it be significantly faster than simply doing a * b? Assuming the number we are multiplying is very big.