Math.Max |
Maximum |
---|---|
VB .NET (Visual Basic .NET) | System |
Syntaxe
Function Math.Max(val1 As Byte, val2 As Byte) As Byte |
Function Math.Max(val1 As Decimal, val2 As Decimal) As Decimal |
Function Math.Max(val1 As Double, val2 As Double) As Double |
Function Math.Max(val1 As Short, val2 As Short) As Short |
Function Math.Max(val1 As Integer, val2 As Integer) As Integer |
Function Math.Max(val1 As Long, val2 As Long) As Long |
Function Math.Max(val1 As SByte, val2 As SByte) As SByte |
Function Math.Max(val1 As Single, val2 As Single) As Single |
Function Math.Max(val1 As UShort, val2 As UShort) As UShort |
Function Math.Max(val1 As UInteger, val2 As UInteger) As UInteger |
Function Math.Max(val1 As ULong, val2 As ULong) As ULong |
Paramètres
Nom | Description |
---|---|
val1, val2 | Ces paramètres permettent d'indiquer l'expression contenant le nombre à comparer. |
Description
Ces méthodes retournent la plus grande valeur entre les deux paramètres.
Exemple
Voici un exemple permet d'afficher les plus grandes valeurs :
- Module Module1
-
- Sub Main()
- Console.WriteLine("MAX(5,-18)=" & Math.Max(5, -18))
- Console.WriteLine("MAX(0.25,0.115)=" & Math.Max(0.25, 0.115))
- Console.WriteLine("MAX(1,2)=" & Math.Max(1, 2))
- Console.WriteLine("MAX(5,4)=" & Math.Max(5, 4))
- Console.WriteLine("MAX(24,34)=" & Math.Max(24, 34))
- End Sub
-
- End Module
on obtiendra le résultat suivant :
MAX(5,-18)=5MAX(0.25,0.115)=0,25
MAX(1,2)=2
MAX(5,4)=5
MAX(24,34)=34
Voir également
Langage de programmation - C# (C Sharp) - Référence des classes - Math - max
Langage de programmation - JavaScript - Référence des classes - Math - max
Langage de programmation - Java - Référence des classes (JFC) - Math
Dernière mise à jour : Dimanche, le 9 novembre 2014