public INumber Product(INumber[] arrayNumbers) { INumber res = arrayNumbers[0]; for (var i = 1; i < arrayNumbers.Length; ++i) { res.Multiply(arrayNumbers[i]); } return(res); }
public INumber Divide(INumber other) { //a+bi //c+di // (a+bi)*(conj)/((c+bi)*conj); INumber first = this; ComplexNumber second = other as ComplexNumber; INumber conjugatedDenominator = second.ComplexСonjugate(); second = (ComplexNumber)second.Multiply(conjugatedDenominator); first = first.Multiply(conjugatedDenominator).Multiply(new RealNumber(second.Real)); return(first); }