Hacker News new | ask | show | jobs
by extrememacaroni 3146 days ago
You read up on using bitwise operations to perform the usual ones, "how about you do some multiplication without actual multiplication" is one of the main interview inventions you want to know how to handle.
1 comments

There's no straightforward way of implementing a general exponentiation function using only bitwise operations. Of course it is straightforward to compute 2^x for x an integer >= 0, or x*2, but it's not clear that this is the question that was posed.