I need to know the results of those expressions (I need them for my Scheme interpreter).
$$ (-9)^{1/2} $$ $$ (-9)^{2/3} $$ $$ (-9)^{-1/2} $$ $$ (-9)^{-2/3} $$
The value can be any negative value, and the exponent can be any fraction.
I came up with this equation (not on my own) that seems to work the same as my reference scheme implementation, but I'm not sure if this is correct:
$$ a^b=|a|^{1/2}i,\text{ when } a < 0\ and\ b = 1/2 $$
$$ a^b=-\frac{1}{|a|^{1/2}i},\text{ when } a < 0\text{ and } b = -1/2 $$
and
$$ a^b=\ |a|^{b}\cos(b\pi)+|a|^{b}\sin(b\pi)i,\text{ when } a < 0\ \text{ and} b\ \not = \pm 1/2 $$
The first two are to get an exact number without any floats and rounding errors.
Are those equations correct?