Max + Min + Min_No0s

Calculate maximum of array of numbers
or Minimum of array of numbers
Also, the Min_No0s will get the min ignoring zeros in the array


Public

Tested

My Own Work
Function Max(arrNumbers)
 Dim Result
 Result     = arrNumbers(0)
 for each i in arrNumbers
  If i > Result then
   Result   = i
  End if
 Next
 Max      = Result
End function
' Returns the numerically lowest value from a given array.
Function Min(arrNumbers)
 Dim Result
 Result     = arrNumbers(0)
 for each i in arrNumbers
  if i < Result then
   Result   = i
  end if
 next
 Min      = Result
End function
Function Min_No0s(arrNumbers)
 Dim Result
 Result     = arrNumbers(0)
 For Each i in arrNumbers
  If i < Result And I <> 0 Then
   Result   = i
  End if
 Next
 Min_No0s     = Result
End function

arrNumbers

Views 100 Downloads 31

Classic ASP Math
ANmarAmdeen
674
Attachments
Revisions

v1.0