C# version of the "Power" class for MatLab