I'm working on an averages app.
I have some algorithms, that i haven't found any online calculators to test with
Cubic mean
Power mean
Are my calculations correct?
Thanks for any help
I have some algorithms, that i haven't found any online calculators to test with
Cubic mean
Code:
Dim sum As Decimal
For x As Integer = 0 To numbersAsInteger.GetUpperBound(0)
sum += CDec(numbersAsInteger(x) * (3 / (x + 1)))
Next
Return Math.Pow((sum / numbersAsInteger.Count), 1 / 3)
Code:
If frm.ShowDialog = DialogResult.OK Then
Dim p As Integer = CInt(frm.NumericUpDown1.Value)
Dim sum As Decimal
For x As Integer = 0 To numbersAsInteger.GetUpperBound(0)
sum += CDec(numbersAsInteger(x) * (p / (x + 1)))
Next
Return Math.Pow((sum / numbersAsInteger.Count), 1 / p)
End If
Thanks for any help