public void testPowNaNExponent() { Complex x = new Complex(3, 4); assertTrue(x.pow(Complex.NaN).isNaN()); }
public void testPowInf() { TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(oneInf)); TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(oneNegInf)); TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(infOne)); TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(infInf)); TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(infNegInf)); TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(negInfInf)); TestUtils.assertSame(Complex.NaN, Complex.ONE.pow(negInfNegInf)); TestUtils.assertSame(Complex.NaN, infOne.pow(Complex.ONE)); TestUtils.assertSame(Complex.NaN, negInfOne.pow(Complex.ONE)); TestUtils.assertSame(Complex.NaN, infInf.pow(Complex.ONE)); TestUtils.assertSame(Complex.NaN, infNegInf.pow(Complex.ONE)); TestUtils.assertSame(Complex.NaN, negInfInf.pow(Complex.ONE)); TestUtils.assertSame(Complex.NaN, negInfNegInf.pow(Complex.ONE)); TestUtils.assertSame(Complex.NaN, negInfNegInf.pow(infNegInf)); TestUtils.assertSame(Complex.NaN, negInfNegInf.pow(negInfNegInf)); TestUtils.assertSame(Complex.NaN, negInfNegInf.pow(infInf)); TestUtils.assertSame(Complex.NaN, infInf.pow(infNegInf)); TestUtils.assertSame(Complex.NaN, infInf.pow(negInfNegInf)); TestUtils.assertSame(Complex.NaN, infInf.pow(infInf)); TestUtils.assertSame(Complex.NaN, infNegInf.pow(infNegInf)); TestUtils.assertSame(Complex.NaN, infNegInf.pow(negInfNegInf)); TestUtils.assertSame(Complex.NaN, infNegInf.pow(infInf)); }
public void testPow() { Complex x = new Complex(3, 4); Complex y = new Complex(5, 6); Complex expected = new Complex(-1.860893, 11.83677); TestUtils.assertEquals(expected, x.pow(y), 1.0e-5); }