Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 857 of 2109
DateTime.ToBinary() Method in C#
The DateTime.ToBinary() method in C# is used to serialize the current DateTime object to a 64-bit binary value that can be used to recreate the DateTime object. The return value is a 64-bit signed integer that encodes both the date/time value and the DateTimeKind. Syntax Following is the syntax − public long ToBinary(); Return Value The method returns a long (64-bit signed integer) that represents the serialized DateTime. This binary value can later be used with DateTime.FromBinary() to reconstruct the original DateTime object. How It Works The binary representation encodes different ...
Read MoreDateTime.ToFileTime() Method in C#
The DateTime.ToFileTime() method in C# converts the value of the current DateTime object to a Windows file time. Windows file time represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (UTC). This method is particularly useful when working with file system operations, as Windows uses this format internally for file timestamps. Syntax Following is the syntax − public long ToFileTime(); Return Value The method returns a long value representing the current DateTime object as a Windows file time. How It Works The method ...
Read MoreBitConverter.DoubleToInt64Bits() Method in C#
The BitConverter.DoubleToInt64Bits() method in C# converts a double-precision floating-point number to its 64-bit signed integer binary representation. This method is useful for examining the underlying binary structure of floating-point numbers or for low-level operations that require access to the raw bits. Syntax Following is the syntax for the DoubleToInt64Bits() method − public static long DoubleToInt64Bits(double value); Parameters value − The double-precision floating-point number to convert. Return Value Returns a 64-bit signed integer whose value is equivalent to the binary representation of the input double value. ...
Read MoreBitConverter.Int64BitsToDouble() Method in C#
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 MoreDecimal.ToUInt32() Method in C#
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 MoreDecimal.ToUInt64() Method in C#
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 MoreInt32.GetTypeCode Method in C# with Examples
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 MoreUInt64.CompareTo() Method in C# with Examples
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 MoreUInt64.Equals Method in C# with Examples
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 MoreUInt64.GetTypeCode() Method in C# with Examples
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