public void TestUncertaintyDivideConstant() { var u1 = new Uncertainty(6, 0.3, 0.2); var u2 = u1.Divide(3); Assert.AreEqual(u2, u1 / 3); Assert.AreEqual(0.5, (3 / u1).Value, 0.00001); Assert.AreEqual(2, u2.Value); Assert.AreEqual(0.1, u2.LowerUncertainty, 0.00001); Assert.AreEqual(0.0666667, u2.UpperUncertainty, 0.00001); Assert.IsFalse(u2.IsRelative); }
public void TestUncertaintyDivide() { var u1 = new Uncertainty(12, 0.2, 1.0); var u2 = new Uncertainty(3, 0.1, 0.1); var u3 = u1.Divide(u2); Assert.AreEqual(u3, u1 / u2); Assert.AreEqual(4, u3.Value); Assert.AreEqual(0.2, u3.LowerUncertainty, 0.00001); Assert.AreEqual(0.466667, u3.UpperUncertainty, 0.00001); Assert.IsTrue(u3.IsRelative); }