예제 #1
0
 public void SqrRootDoubleArrayTest()
 {
     double[] x = { 1.2, 2.5, 6.2 };
     double[] c = SquareRoot.Root(arrayC);
     for (int i = 0; i < c.Length; i++)
     {
         Assert.AreEqual(x[i], c[i]);
     }
 }
예제 #2
0
        public void RootIntArrayTest()
        {
            double[] d = SquareRoot.Root(f);
            int      i = 0;

            foreach (double z in d)
            {
                Assert.AreEqual(SquareRoot.Root(f[i]), z);
                i++;
            }
        }
예제 #3
0
        public void RootDoubleArrayTest()
        {
            double[] y = SquareRoot.Root(e);
            int      i = 0;

            foreach (double w in y)
            {
                Assert.AreEqual(SquareRoot.Root(e[i]), w);
                i++;
            }
        }
예제 #4
0
        public static double StandardDev(dynamic values)
        {
            double mean       = StatisticMean.Mean(values);
            double difference = 0;
            double variance   = 0;

            foreach (int a in values)
            {
                difference = Subtraction.Subtract((int)mean, a);
                difference = Math.Pow(difference, 2);
                variance   = addition.Sum(variance, (int)difference);
            }
            int ValueCount = Helpers.Arrays.Length(values);

            variance = Division.Quotient(variance, ValueCount);
            double standardDev = SquareRoot.Root(variance);

            return(standardDev);
        }
예제 #5
0
 public void RootDoubleTest()
 {
     Assert.AreEqual(6.7, SquareRoot.Root(c));
 }
예제 #6
0
 public void RootTest()
 {
     Assert.AreEqual(3, SquareRoot.Root(a));
 }
예제 #7
0
 public void RootTest()
 {
     Assert.AreEqual(2.236, SquareRoot.Root(b));
 }
 public dynamic Root(dynamic a)
 {
     result = SquareRoot.Root(a);
     return(result);
 }
예제 #9
0
        public void SqrRootDoubleTest()
        {
            double c = SquareRoot.Root(i);

            Assert.AreEqual(1.5, c);
        }
예제 #10
0
        public void SqrRootIntTest()
        {
            int c = SquareRoot.Root(h);

            Assert.AreEqual(12, c);
        }
예제 #11
0
 public void RootDoubleTest()
 {
     Assert.AreEqual(8.0, SquareRoot.Root(b));
 }
예제 #12
0
 public void SquareRootDoubleTest()
 {
     Assert.AreEqual(1.5, SquareRoot.Root(b));
 }