How would you solve a negative number raised to a fraction a/b if b is odd and a is evem? Ignoring imaginary numbers
i.e $(-1)^\frac23$ Calculator returns an error
$(-1)^\frac 13 (-1)^\frac 13$ = -1.-1 = 1 (By law of indices)
or
$(-1^\frac13 )^2$ = 1
or
$(-1^2)^\frac13$ = 1
What about for other cases of a and b?
Your example pretty much handles the generic case, as long as you are dealing strictly with real numbers.
If $b$ is odd and $a$ is even, you would be extracting an odd root (which always exists, whether the base is positive or negative), and raising the result to an even power (which gets rid of the negative sign).
The same thing happens if you do it in the reverse order. So the result would be a well-defined positive number.
The real problems arise if $b$ is even. In that case, you will have to insist on a set of ground rules (for example, you must insist that $a/b$ is reduced to lowest terms, otherwise you would have a problem determining $(-1)^{2/6}$ which should be the same as $(-1)^{1/3}$).