The result is going to be complex number, so you have to use Complex
class from System.Numerics
namespace.
Complex n = new Complex(-2, 0);
Complex result = Complex.Pow(n, 1.1);
In case if result is real number (integer power), then you can use Math.Pow
.
As @JeppeStigNielsen mentioned, the conversion from int
/double
to Complex
is implicit, so the code can be shortened to:
Complex result = Complex.Pow(-2, 1.1);