AWOL is, as usual, perfectly correct. That answer is technically perfectly correct but may not provide the answers you Need. You Problem has been dealt with before. Refer to: Weird but true pow(x,y) function - Frequently-Asked Questions - Arduino Forum
From that thread, and considering that you are always wanting powers of 2, you may be better off simply using the method explained there by halley (Integer powers of two are ridiculously easy, since all computations are done in binary (a numbering system based on integer powers of two). If you want 2 to the 4th power, then say (1<<4). It's fast and accurate for integers.)