Exemplo n.º 1
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 = SquareRootNumber.Root(variance);

            return(standardDev);
        }
Exemplo n.º 2
0
 public dynamic Root(dynamic a)
 {
     result = SquareRootNumber.Root(a);
     return(result);
 }
 public void SqRoot()
 {
     Assert.AreEqual(5, SquareRootNumber.Root(d));
 }
 public void SqRootTest()
 {
     Assert.AreEqual(3, SquareRootNumber.Root(a));
 }