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 meanCode: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)
Are my calculations correct?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




Reply With Quote