public void Q8_24_DivideSimple() { var pos = new Fixed <Q8_24>(10); var neg = new Fixed <Q8_24>(-5); var posRes = pos.Divide(pos); var posNeg = pos.Divide(neg); var negPos = neg.Divide(pos); var negRes = neg.Divide(neg); Assert.AreEqual("1", posRes.ToString()); Assert.AreEqual("-2", posNeg.ToString()); Assert.AreEqual("-0,5", negPos.ToString()); Assert.AreEqual("1", negRes.ToString()); }
public void Q24_8_DivideByZero() { var nonZero = new Fixed <Q24_8>(10); var zero = new Fixed <Q24_8>(0); var res = nonZero.Divide(zero); }
public void Q8_24Test() { for (int i = 0; i < 1000; i++) { f9 = f7.Divide(f8); } }
public void Q16_16Test() { for (int i = 0; i < 1000; i++) { f6 = f4.Divide(f5); } }
//[InlineData(14, 12, "26")] public void DivisionTestingSameTypesQ24_8(int in1, int in2, string exp) { var f1 = new Fixed <Q24_8>(in1); var f2 = new Fixed <Q24_8>(in2); Assert.Equal(exp, f1.Divide(f2).ToString()); }
public void Fixed_OperatorDivision() { var f = new Fixed <T>(119); var g = new Fixed <T>(7); Assert.AreEqual(f.Divide(g), f / g); }
public void Q24_8Test() { for (int i = 0; i < 1000; i++) { f3 = f1.Divide(f2); } }
public void DivideHigher() { var f1 = new Fixed <Q8_24>(248); var f2 = new Fixed <Q8_24>(10); var f3 = f1.Divide(f2); Assert.AreEqual(((double)-0.799999952316284).ToString(), f3.ToString()); }
public void DivideHigher() { var f1 = new Fixed <Q16_16>(248); var f2 = new Fixed <Q16_16>(10); var f3 = f1.Divide(f2); Assert.AreEqual(((double)24.7999877929688).ToString(), f3.ToString()); }
public void test7() { var f1 = new Fixed <Q8_24>(625); var f2 = new Fixed <Q8_24>(1000); var f3 = f1.Divide(f2); Assert.AreEqual(f3.ToString(), "-4,70833331346512"); }
public void test6() { var f1 = new Fixed <Q8_24>(248); var f2 = new Fixed <Q8_24>(10); var f3 = f1.Divide(f2); Assert.AreEqual(f3.ToString(), "-0,799999952316284"); }
public void test5() { var f1 = new Fixed <Q8_24>(3); var f2 = new Fixed <Q8_24>(2); var f3 = f1.Divide(f2); Assert.AreEqual(f3.ToString(), "1,5"); }
public void test6() { var f1 = new Fixed <Q24_8>(248); var f2 = new Fixed <Q24_8>(10); var f3 = f1.Divide(f2); Assert.AreEqual(f3.ToString(), "24,796875"); }
public void test6() { var f1 = new Fixed <Q16_16>(248); var f2 = new Fixed <Q16_16>(10); var f3 = f1.Divide(f2); Assert.AreEqual(f3.ToString(), "24,7999877929688"); }
public void DivideHigher() { var f1 = new Fixed <Q24_8>(248); var f2 = new Fixed <Q24_8>(10); var f3 = f1.Divide(f2); Assert.AreEqual(((double)24.796875).ToString(), f3.ToString()); }
public void Division2() { var f1 = new Fixed <Q16_16>(9); var f2 = new Fixed <Q16_16>(3); var f3 = f1.Divide(f2); Assert.AreEqual("3", f3.ToString()); }
public void DivideHigher2() { var f1 = new Fixed <Q8_24>(625); var f2 = new Fixed <Q8_24>(1000); var f3 = f1.Divide(f2); Assert.AreEqual(((double)-4.70833331346512).ToString(), f3.ToString()); }
public void ToDateTimeTesting() { var f1 = new Fixed <Q24_8>(205); var f2 = new Fixed <Q24_8>(10); DateTime dt = f1.Divide(f2).ToDateTime(null); Assert.Equal(new DateTime(2020, 7, 2), dt); }
public void ToSingleTesting() { var f1 = new Fixed <Q16_16>(7); var f2 = new Fixed <Q16_16>(2); float f = f1.Divide(f2).ToSingle(null); Assert.Equal(3.5f, f); }
public void ToDecimalTesting() { var f1 = new Fixed <Q16_16>(7); var f2 = new Fixed <Q16_16>(2); decimal m = f1.Divide(f2).ToDecimal(null); Assert.Equal(3.5m, m); }
public void ToDoubleTesting() { var f1 = new Fixed <Q16_16>(7); var f2 = new Fixed <Q16_16>(2); double d = f1.Divide(f2).ToDouble(null); Assert.Equal(3.5d, d); }
public void Divide() { var f1 = new Fixed <Q24_8>(3); var f2 = new Fixed <Q24_8>(2); var f3 = f1.Divide(f2); Assert.AreEqual(((double)1.5).ToString(), f3.ToString()); }
public void TestDivision(int intValue1, int intValue2, string expectedResult) { f1 = new Fixed <Q>(intValue1); f2 = new Fixed <Q>(intValue2); var f3 = f1.Divide(f2); Assert.AreEqual(expectedResult, f3.ToString()); }
public void DivideHigher2() { var f1 = new Fixed <Q24_8>(625); var f2 = new Fixed <Q24_8>(1000); var f3 = f1.Divide(f2); Assert.AreEqual(((double)0.625).ToString(), f3.ToString()); }
public void test7() { var f1 = new Fixed <Q16_16>(625); var f2 = new Fixed <Q16_16>(1000); var f3 = f1.Divide(f2); Assert.AreEqual(f3.ToString(), "0,625"); }
public void Division1() { var f1 = new Fixed <Q24_8>(3); var f2 = new Fixed <Q24_8>(3); var f3 = f1.Divide(f2); Assert.AreEqual("1", f3.ToString()); }
public static void Divide_divisionOfSimpleNumbers_SideTestOfToString(Fixed <Q> a, Fixed <Q> b) { //Act var result = b.Divide(a); //Assert Assert.AreEqual((42.0 / 24.0).ToString(), result.ToString()); //result test }
public void Division1() { var f1 = new Fixed <Q24_8>(9); var f2 = new Fixed <Q24_8>(2); var f3 = f1.Divide(f2); Assert.AreEqual((9.0 / 2.0).ToString(), f3.ToString()); }
public void Multiplication1() { var f1 = new Fixed <Q24_8>(9); var f2 = new Fixed <Q24_8>(2); var f3 = f1.Divide(f2); f3 = f3.Multiply(f2); Assert.AreEqual(((9.0 / 2.0) * 2).ToString(), f3.ToString()); }
public void Substraction1() { var f1 = new Fixed <Q24_8>(9); var f2 = new Fixed <Q24_8>(2); var f3 = f1.Divide(f2); f3 = f3.Substract(f2); Assert.AreEqual(((9.0 / 2.0) - 2).ToString(), f3.ToString()); }