Ejemplo n.º 1
0
        public void WithZero()
        {
            //---Testing two zeroes
            addExp = new AdditionExp(new Number(0.0), new Number(0.0));
            dif    = new Difference(0.0, addExp.Evaluate());
            Assert.IsTrue(dif.IsAlmostSame());

            //---Testing zero as first argument
            addExp = new AdditionExp(new Number(0.0), new Number(-152.252));
            dif    = new Difference(-152.252, addExp.Evaluate());
            Assert.IsTrue(dif.IsAlmostSame());

            //---Testing zero as second argument
            addExp = new AdditionExp(new Number(3333.025123), new Number(0.0));
            dif    = new Difference(3333.025123, addExp.Evaluate());
            Assert.IsTrue(dif.IsAlmostSame());
        }
Ejemplo n.º 2
0
 public void TwoSpecialFormatNumbers()
 {
     addExp = new AdditionExp(new Number(1.5e23), new Number(3.0e21));
     dif    = new Difference(1.53e23, addExp.Evaluate());
     Assert.IsTrue(dif.IsAlmostSame());
 }
Ejemplo n.º 3
0
 public void TwoOppositeNumbers()
 {
     addExp = new AdditionExp(new Number(734.13623), new Number(-734.13623));
     dif    = new Difference(0.0, addExp.Evaluate());
     Assert.IsTrue(dif.IsAlmostSame());
 }
Ejemplo n.º 4
0
 public void TwoSameNumbers()
 {
     addExp = new AdditionExp(new Number(120.0000001452), new Number(120.0000001452));
     dif    = new Difference(240.0000002904, addExp.Evaluate());
     Assert.IsTrue(dif.IsAlmostSame());
 }
Ejemplo n.º 5
0
 public void TwoDifferentNumbers()
 {
     addExp = new AdditionExp(new Number(-35216.012552), new Number(162.26671));
     dif    = new Difference(-35053.745842, addExp.Evaluate());
     Assert.IsTrue(dif.IsAlmostSame());
 }