Hello, I made a table with all the cases for r < 0 and came up with the following: http://pastebin.com/EVKEuNMG I think that could be done nice . And it have to be more generalized to incoporate r >= 0. Regards Gyro
works with positive and negative bases now. i don't see anything wrong with this. removed old comments too btw, nice solution with the different cases of positive and negatives for the negative base without having static or extern vars http://pastebin.com/qG3d3nhA