示例#1
0
        public static ComplexNumber operator /(ComplexNumber numerator, ComplexNumber denominator)
        {
            ComplexNumber number = new ComplexNumber();

            double divider = (denominator * getReversal(denominator)).getA();

            number = numerator * getReversal(denominator);
            number.setA(number.getA() / divider);
            number.setB(number.getB() / divider);

            return(number);
        }
示例#2
0
        public static ComplexNumber getReversal(ComplexNumber number)
        {
            ComplexNumber result = new ComplexNumber(number.getA(), number.getB() * (-1));

            return(result);
        }