if I do:
int x = 4; pow(2, x);
Is that really that much less efficient than just doing:
1 << 4
?
Generally yes, as bit shift is very basic operation for the processor.
On the other hand many compilers optimise code so that raising to power is in fact just a bit shifting.