We know that the power $a^b$ is, if $b$ is not an integer, the product of a power and a root (example : $2^{2.5}=2^2\sqrt{2}$).
But how do we know, if $a$ is negative, if $a^b$ is complex ?
For example, $(-1)^{2.5}$ is complex ($i$), but $(-1)^\frac{7}{3}$ is real. For simple exponents, it seems simple, but how to know when the exponent is more "complicated" ?

What about the following: a number is real if the imaginary component is zero.
Let's have a look at
a = abs(a) * (cos(180°) + i * sin(180°)) = abs(a) * (e^180°)a^b = abs(a)^b * (e^(180°*b)) = abs(a) * (cos(180°*b) + i * sin(180°*b))This is real if the imaginary part is zero:
sin(180°*b) = 0This is true if
180°*bis a whole multiple of 180°, which means thatbis a whole number.This means that for a negative number
a:a^bis real ifbis a whole number.