Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Function calcStandardDeviation(number As Double) As Double
|
||||
Static a() As Double
|
||||
Redim Preserve a(0 To UBound(a) + 1)
|
||||
Dim ub As UInteger = UBound(a)
|
||||
a(ub) = number
|
||||
Dim sum As Double = 0.0
|
||||
For i As UInteger = 0 To ub
|
||||
sum += a(i)
|
||||
Next
|
||||
Dim mean As Double = sum / (ub + 1)
|
||||
Dim diff As Double
|
||||
sum = 0.0
|
||||
For i As UInteger = 0 To ub
|
||||
diff = a(i) - mean
|
||||
sum += diff * diff
|
||||
Next
|
||||
Return Sqr(sum/ (ub + 1))
|
||||
End Function
|
||||
|
||||
Dim a(0 To 7) As Double = {2, 4, 4, 4, 5, 5, 7, 9}
|
||||
|
||||
For i As UInteger = 0 To 7
|
||||
Print "Added"; a(i); " SD now : "; calcStandardDeviation(a(i))
|
||||
Next
|
||||
|
||||
Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue