How to raise something to a power using bitwise

Mar 1, 2017 at 4:30pm
My professor said that we should know how to raise some number to some power using bitwise. I've searched the internet and reviewed his powerpoints and I think masking maybe involved but I'm not sure. I'm pretty new to C++ and the jargon is still hard for me to follow sometimes. Could anyone explain how this would be done? Pseudocode would work just fine, I think. It's not for an assignment that I actually have to code. I'm just trying to understand the concepts. Thanks.

Mar 1, 2017 at 5:11pm
Given an integer 0 <= n < m, 1 << n is equal to 2n, where m = sizeof(int) * CHAR_BIT. On most platforms, m = 32 or m = 64.
Mar 1, 2017 at 5:31pm
Thanks. I can follow that. I appreciate your help.
Topic archived. No new replies allowed.