April 2002
Intermediate to advanced
688 pages
19h 51m
English
Max Function
System.Math
Math.Max(val1,val2)
val1, val2 (required; any)A numeric data type or expression
Returns the maximum of val1 and
val2, in the widest datatype of the two
numbers
Returns the maximum of val1 and
val2
If the two arguments do not have the same data type, then the narrower data type is cast to the wider type. For instance, the line:
Dim x As Integer = 5 Dim y As Double = 454.8 MsgBox(Math.Max(x, y))
displays 454.8.
This is a Shared member, so it can be used without creating any objects.
The Max function is new to the .NET Framework.
Read now
Unlock full access