Calculating powers I was thinking how I could program powers into my application. And I want to do this without using the default math libraries. I want to use only +,-,* and /. So I wondered what is the definition of a power. I came across this definition of $a^{b}$:
$$
a^b = e^{b \ln a} = \sum_{n=0}^\infty \frac{(b \ln a)^n}{n!}
$$
The thing here, is that to calculate a power, you'd have to use a power. This seems kind of odd to me because that would make it impossible to program a power. So is there a way to calculate a power without using a power?
It's not as simple as $x*x*x$ since I want to calculate powers like $2^{-3,29032}$. 
EDIT:
I just finished to code, calculating it the long way and I came across the infamous x^0. What should I do now, just put in 1?
 A: As you have discovered, the definition for general powers are
$$
a^b = e^{b \ln a} = \sum_{n=0}^\infty \frac{(b \ln a)^n}{n!}
$$
It is much easier to define for integral powers, $b \in \mathbb{Z}$, where
$$
\begin{alignat*}{4}
a^0 & = 1, \\
a^b & = a \cdot a^{b-1}   &\quad& \text{when } b > 0, \\
a^b & = \frac{1}{a^{|b|}} && \text{when } b < 0.
\end{alignat*}
$$
Since the definition for general powers only makes use of the definition of integral powers, which in turn only use multiplication, then you have reduced the problem to calculate a sum.
For quick calculation of integral powers, you might wish to refer to this page.
As for calculating the sum, since $n!$ grows so quickly, you can approximate it by
$$
a^b = e^{b \ln a} \approx \sum_{n=0}^{100} \frac{(b \ln a)^n}{n!}
$$
since after $n=100$ the change is unlikely to be representable for computers.
Primary source: Wikipedia article on the exponential function.
A: Given any $\alpha\in{\mathbb C}$ one has the binomial series, giving the  value of $$(1+x)^\alpha:=\exp\bigl(\alpha\log(1+x)\bigr)$$ without taking recourse to any tables:
$$(1+x)^\alpha=\sum_{k=0}^\infty {\alpha\choose k}\>x^k\qquad(-1<x<1)\ .$$
Here
$${\alpha\choose k}:={\alpha(\alpha-1)\cdots(\alpha-k+1)\over k!}$$
is a generalized binomial coefficient.
If you want $y^\alpha$ for a given $y>0$ let $x:=1-y$ when $y<1$, and let $x:=-{y-1\over y}$ when $y>1$, then take the reciprocal of the result.
A: If you only want to do integer powers, you may use iterated multiplication ($x^3 = x * x * x$), and for negative powers $x^{-n}$, you may calculate $x^n$, then take the reciprocal $$\frac{1}{x^n}= x^{-n}$$This should be much easier than programming natural logarithms or infinite sums.
As an added bonus, you could use a little more memory and save some computation time by finding the powers $x, x^2, x^4, \ldots, x^{\log_2(n)}$, then use these as your building blocks to achieve exponentiation in $O(\log_2(n))$ time as opposed to $O(n)$.
