C# Math Min(UInt64, UInt64)
Description
Math Min(UInt64, UInt64)
returns the smaller of two 64-bit
unsigned integers.
Syntax
Math.Min(UInt64, UInt64)
has the following syntax.
[CLSCompliantAttribute(false)]/*from ww w. jav a 2 s . c o m*/
public static ulong Min(
ulong val1,
ulong val2
)
Parameters
Math.Min(UInt64, UInt64)
has the following parameters.
val1
- The first of two 64-bit unsigned integers to compare.val2
- The second of two 64-bit unsigned integers to compare.
Returns
Math.Min(UInt64, UInt64)
method returns Parameter val1 or val2, whichever is smaller.
Example
The following example demonstrates how to use the Min method to return and display the smaller of two variables.
using System;/* www .ja v a 2s .c om*/
class Sample
{
public static void Main()
{
long xLong1 = -4, xLong2 = 54;
Console.WriteLine(Math.Min(xLong1, xLong2));
}
}
The code above generates the following result.