For a personal project, I had to figure out what happens when $-1$ (negative one) is raised to fractional powers lying between $0$ and $1$. I thought that if I get a power $x = 0.a_1a_2a_3...a_n$ (where $a_1,...,a_n$ are digits), then I could express it as:
$$ x = 0.a_1a_2a_3...a_n = \frac{(a_1a_2a_3...a_n)}{10^n}. $$
Then, by examining whether $a_n$ is odd or even, I could tell if $(-1)^x = 1$ or a complex number. If $a_n$ is even, then $(-1)^x = 1$, else it's some complex number.
Basically, if I have a number like $(-1)^{0.222}$, I could write it as
$$ (-1)^{0.222} = (-1)^{222/1000} = ((-1)^{222})^{1/1000} = 1^{1/1000} = 1 . $$
Using Math.pow(-1, 0.222)
on Java also gives the result $1$. However, putting in the same expression (i.e. $(-1)^{0.222}$) on Google's online calculator gives the result
$$ (-1)^{0.222} = 0.766493007 + 0.642252653 \ i. $$
What is going on here? Why is a complex number given as output?