Esempio n. 1
0
        public void DivBinomTest()
        {
            //arrange
            double      TOL = 1E-10;
            CPolynomial f = new CPolynomial(new Complex[] { 3, 0.2, new Complex(3, 8.2), -0.16, new Complex(2.3, 2), 0, 18.3466, 2000 });
            Complex     c = 346.34645;
            Complex     r, rtest;

            //action
            CPolynomial q = CPolynomial.DivBinom(f, c, out r);

            f[0] -= r;
            CPolynomial qtest = CPolynomial.DivBinom(f, c, out rtest);

            //assert
            Complex.Abs(rtest).Should().BeLessOrEqualTo(TOL);
            q.Should().Be(qtest);
        }