J
Justin Caldicott
Hi
There are n solutions to the nth root of any number, eg:
(-8)^(1/3) = 1 + sqrt(3)i
or -2
or 1 - sqrt(3)i
The following code:
complex<double> x = -8;
complex<double> cbrtX = pow(x, 1.0/3.0);
gives cbrtX = 1 + sqrt(3)i, the first solution from above. (with both MS and
STLPort 4.6 versions of the C++ standard library)
My question is, does anyone know a method of retrieving the other solutions?
Perhaps -2 is the most useful solution, as it is purely real..
Thanks
Justin
There are n solutions to the nth root of any number, eg:
(-8)^(1/3) = 1 + sqrt(3)i
or -2
or 1 - sqrt(3)i
The following code:
complex<double> x = -8;
complex<double> cbrtX = pow(x, 1.0/3.0);
gives cbrtX = 1 + sqrt(3)i, the first solution from above. (with both MS and
STLPort 4.6 versions of the C++ standard library)
My question is, does anyone know a method of retrieving the other solutions?
Perhaps -2 is the most useful solution, as it is purely real..
Thanks
Justin