Example #1
0
 public void testExp() {
   Complex z = new Complex(3, 4);
   Complex expected = new Complex(-13.12878, -15.20078);
   TestUtils.assertEquals(expected, z.exp(), 1.0e-5);
   TestUtils.assertEquals(Complex.ONE, Complex.ZERO.exp(), 10e-12);
   Complex iPi = Complex.I.multiply(new Complex(pi, 0));
   TestUtils.assertEquals(Complex.ONE.negate(), iPi.exp(), 10e-12);
 }
Example #2
0
 public void testExpInf() {
   TestUtils.assertSame(Complex.NaN, oneInf.exp());
   TestUtils.assertSame(Complex.NaN, oneNegInf.exp());
   TestUtils.assertSame(infInf, infOne.exp());
   TestUtils.assertSame(Complex.ZERO, negInfOne.exp());
   TestUtils.assertSame(Complex.NaN, infInf.exp());
   TestUtils.assertSame(Complex.NaN, infNegInf.exp());
   TestUtils.assertSame(Complex.NaN, negInfInf.exp());
   TestUtils.assertSame(Complex.NaN, negInfNegInf.exp());
 }