I know power of 2 can be implemented using << operator. What about power of 10? Like 10^5? Is there any way faster than pow(10,5) in C++? It is a pretty straight-forw
You can use the lookup table which will be by far the fastest
You can also consider using this:-
template T expt(T p, unsigned q) { T r(1); while (q != 0) { if (q % 2 == 1) { // q is odd r *= p; q--; } p *= p; q /= 2; } return r; }