power function implementation in C+