Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Namespace Sitesource.Util
- ''' <summary>
- ''' Yes I'm aware that there MUST be a lot of better ways than this, but for now this works.
- ''' </summary>
- ''' <remarks></remarks>
- Public Class Calc
- ''' <summary>
- ''' Get max of a series of numbers
- ''' </summary>
- ''' <param name="values"></param>
- ''' <returns></returns>
- ''' <remarks></remarks>
- Public Shared Function Max(ByVal ParamArray values() As Decimal) As Decimal
- If values.Length < 1 Then Throw New ArgumentNullException
- Dim _max As Decimal = Decimal.MinValue
- For Each value As Decimal In values
- _max = Math.Max(_max, value)
- Next
- Return _max
- End Function
- ''' <summary>
- ''' Get max of a series of numbers
- ''' </summary>
- ''' <param name="values"></param>
- ''' <returns></returns>
- ''' <remarks></remarks>
- Public Shared Function Min(ByVal ParamArray values() As Decimal) As Decimal
- If values.Length < 1 Then Throw New ArgumentNullException
- Dim _min As Decimal = Decimal.MaxValue
- For Each value As Decimal In values
- _min = Math.Min(_min, value)
- Next
- Return _min
- End Function
- End Class
- End Namespace
Advertisement
Add Comment
Please, Sign In to add comment