Csharp Articles

Page 182 of 196

BitConverter.Int64BitsToDouble() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 145 Views

The BitConverter.Int64BitsToDouble() method in C# is used to reinterpret the specified 64-bit signed integer to a double-precision floating-point number. This method performs a bit-level reinterpretation rather than a numeric conversion, meaning it treats the long integer's binary representation as if it were the binary representation of a double. Syntax Following is the syntax − public static double Int64BitsToDouble(long value); Parameters value − A 64-bit signed integer whose bit pattern will be reinterpreted as a double-precision floating-point number. Return Value This method returns a double-precision floating-point number whose bit representation ...

Read More

Decimal.ToUInt32() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 126 Views

The Decimal.ToUInt32() method in C# is used to convert the value of the specified Decimal to the equivalent 32-bit unsigned integer. This method performs truncation, discarding the fractional part and returning only the integer portion. Syntax Following is the syntax − public static uint ToUInt32(decimal val); Parameters val − The decimal number to convert to a 32-bit unsigned integer. Return Value Returns a 32-bit unsigned integer (uint) that represents the truncated value of the specified decimal. The fractional part is discarded. How It Works The method converts a decimal ...

Read More

Decimal.ToUInt64() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 87 Views

The Decimal.ToUInt64() method in C# converts a decimal value to a 64-bit unsigned integer (ulong). This method performs truncation, meaning it removes the fractional part and returns only the integer portion of the decimal number. Syntax Following is the syntax − public static ulong ToUInt64(decimal value); Parameters value − The decimal number to convert to a 64-bit unsigned integer. Return Value Returns a ulong (64-bit unsigned integer) that represents the truncated value of the specified decimal. Decimal to UInt64 Conversion ...

Read More

Int32.GetTypeCode Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 179 Views

The Int32.GetTypeCode() method in C# returns the TypeCode enumeration value for the Int32 data type. This method is inherited from the IConvertible interface and is useful for type identification and runtime type checking operations. Syntax Following is the syntax − public TypeCode GetTypeCode(); Return Value This method returns TypeCode.Int32 for all int values, regardless of their actual numeric value. Using GetTypeCode() for Type Identification Example Let us see an example to implement the Int32.GetTypeCode() method − using System; public class Demo { public ...

Read More

UInt64.CompareTo() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 256 Views

The UInt64.CompareTo() method in C# is used to compare the current instance to a specified object or UInt64 and returns an indication of their relative values. This method is essential for sorting operations and numerical comparisons with 64-bit unsigned integers. Syntax The UInt64.CompareTo() method has two overloads − public int CompareTo(object val); public int CompareTo(ulong val); Parameters val − An object or unsigned 64-bit integer to compare with the current instance. Return Value The method returns an integer that indicates the relative position of the current instance ...

Read More

UInt64.Equals Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 182 Views

The UInt64.Equals() method in C# returns a value indicating whether this instance is equal to a specified object or UInt64. This method provides a way to compare 64-bit unsigned integer values for equality, offering both generic object comparison and type-specific comparison overloads. Syntax Following is the syntax for both overloads of the UInt64.Equals() method − public override bool Equals(object obj); public bool Equals(ulong value); Parameters The UInt64.Equals() method accepts the following parameters − obj − An object to compare to this instance (first overload) value − A 64-bit unsigned integer to ...

Read More

UInt64.GetTypeCode() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 160 Views

The UInt64.GetTypeCode() method in C# returns the TypeCode enumeration value for the UInt64 data type. This method is inherited from the IConvertible interface and helps identify the specific type of a value at runtime. The TypeCode enumeration provides a way to categorize the built-in .NET data types, making it useful for type checking and conversion operations. Syntax Following is the syntax − public TypeCode GetTypeCode(); Return Value This method always returns TypeCode.UInt64 for any ulong value, as all UInt64 instances belong to the same data type. Example Let us see ...

Read More

Type.GetInterface() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 288 Views

The Type.GetInterface() method in C# is used to get a specific interface implemented or inherited by the current Type. This method searches through all interfaces implemented by a type and returns the one that matches the specified name. Syntax Following are the overloads of the GetInterface() method − public Type GetInterface(string name); public abstract Type GetInterface(string name, bool ignoreCase); Parameters name − The name of the interface to find. ignoreCase − A Boolean value indicating whether to perform a case-insensitive search for the interface name. Return ...

Read More

DateTime.CompareTo() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 1K+ Views

The DateTime.CompareTo() method in C# is used to compare the value of this instance to a specified DateTime value. It returns an integer indicating the chronological relationship between two DateTime objects. Syntax Following is the syntax − public int CompareTo(DateTime value); Parameters value − The DateTime object to compare with the current instance. Return Value It returns an integer value − < 0 − If this instance is earlier than the specified value 0 − If this instance is the same as the specified value > 0 − If ...

Read More

DateTime.Equals() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 2K+ Views

The DateTime.Equals() method in C# is used to check whether two DateTime objects or instances are equal or not. It returns true if both are equal, otherwise false. This method performs a tick-by-tick comparison, meaning it compares the exact moment in time down to the smallest unit (100-nanosecond intervals). Two DateTime objects are considered equal only if they represent the exact same point in time. Syntax Following is the syntax for the static DateTime.Equals() method − public static bool Equals(DateTime date1, DateTime date2); Parameters date1 − The first DateTime object ...

Read More
Showing 1811–1820 of 1,951 articles
« Prev 1 180 181 182 183 184 196 Next »
Advertisements