C# UInt32 CompareTo(UInt32)

Description

UInt32 CompareTo(UInt32) compares this instance to a specified 32-bit unsigned integer and returns an indication of their relative values.

Syntax

UInt32.CompareTo(UInt32) has the following syntax.


public int CompareTo(
  uint value
)

Parameters

UInt32.CompareTo(UInt32) has the following parameters.

  • value - An unsigned integer to compare.

Returns

UInt32.CompareTo(UInt32) method returns A signed number indicating the relative values of this instance and value. Return value Description Less than zero This instance is less than value. Zero This instance is equal to value. Greater than zero This instance is greater than value.

Example


using System;//  w w w .  ja  v  a 2s .c  o  m
public class MainClass{
  public static void Main(String[] argv){  
    System.Console.WriteLine(UInt32.MinValue.CompareTo((UInt32)123));
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version