C# Math Min(Byte, Byte)
Description
Math Min(Byte, Byte)
returns the smaller of two 8-bit
unsigned integers.
Syntax
Math.Min(Byte, Byte)
has the following syntax.
public static byte Min(
byte val1,
byte val2
)
Parameters
Math.Min(Byte, Byte)
has the following parameters.
val1
- The first of two 8-bit unsigned integers to compare.val2
- The second of two 8-bit unsigned integers to compare.
Returns
Math.Min(Byte, Byte)
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;//from w ww . ja va 2 s . c om
class Sample
{
public static void Main()
{
byte xByte1 = 1, xByte2 = 51;
Console.WriteLine(Math.Min(xByte1, xByte2));
}
}
The code above generates the following result.