Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.
Become a Premium Member and unlock a new, free course in leading technologies each month.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
public static double StandardDeviation(List<double> num)
{
double SumOfSqrs = 0;
double avg = num.Average();
for (int i = 0; i < num.Count; i++)
{
SumOfSqrs += Math.Pow(((double)num[i] - avg), 2);
}
double n = (double)num.Count;
if (n == 1)
{
return Math.Sqrt(SumOfSqrs);
}
else
{
return Math.Sqrt(SumOfSqrs / (n - 1));
}
}
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.