C# Math Max(Int64, Int64)
Description
Math Max(Int64, Int64)
returns the larger of two 64-bit
signed integers.
Syntax
Math.Max(Int64, Int64)
has the following syntax.
public static long Max(
long val1,
long val2
)
Parameters
Math.Max(Int64, Int64)
has the following parameters.
val1
- The first of two 64-bit signed integers to compare.val2
- The second of two 64-bit signed integers to compare.
Returns
Math.Max(Int64, Int64)
method returns Parameter val1 or val2, whichever is larger.
Example
The following example demonstrates how to use the Max method to return and display the greater of two variables.
using System;/*w w w . ja v a 2 s. co m*/
class Sample
{
public static void Main()
{
long xLong1 = -4, xLong2 = 54;
Console.WriteLine(Math.Max(xLong1, xLong2));
}
}
The code above generates the following result.