AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 214 of 840

Decimal.Add() Method in C#

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

The Decimal.Add() method in C# is a static method that adds two specified decimal values and returns their sum. This method provides precise decimal arithmetic, which is essential for financial calculations where floating-point errors must be avoided. Syntax Following is the syntax − public static decimal Add(decimal val1, decimal val2); Parameters val1 − The first decimal value to add. val2 − The second decimal value to add. Return Value Returns a decimal value that represents the sum of val1 and val2. Using Decimal.Add() with Regular Values Example ...

Read More

Decimal.Ceiling() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 451 Views

The Decimal.Ceiling() method in C# returns the smallest integral value that is greater than or equal to the specified decimal number. This method rounds up to the nearest whole number, regardless of whether the decimal portion is less than or greater than 0.5. Syntax Following is the syntax − public static decimal Ceiling(decimal val); Parameters val − A decimal number that needs to be rounded up to the nearest integer. Return Value Returns a decimal value representing the smallest integer greater than or equal to the input value. ...

Read More

Decimal.ToByte() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 314 Views

The Decimal.ToByte() method in C# converts a decimal value to its equivalent 8-bit unsigned integer (byte). This method truncates the decimal portion and returns only the integer part. The byte data type can store values from 0 to 255. Syntax Following is the syntax − public static byte ToByte(decimal val); Parameters val − The decimal number to convert to a byte value. Return Value Returns a byte value that represents the truncated integer portion of the specified decimal. If the decimal is negative, it rounds toward zero. How ...

Read More

BitConverter.DoubleToInt64Bits() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 137 Views

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 More

Char.Equals() Method in C#

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

The Char.Equals() method in C# is used to compare two character values for equality. It returns true if the character instance is equal to the specified character value, and false otherwise. This method is case-sensitive and performs an exact character comparison. Syntax Following is the syntax for the Char.Equals() method − public bool Equals(char value); public override bool Equals(object obj); Parameters value − A character to compare with the current character instance. obj − An object to compare with the current character instance. Return Value ...

Read More

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

Char.GetNumericValue() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 675 Views

The Char.GetNumericValue() method in C# converts a specified Unicode character to its corresponding numeric value as a double. This method is particularly useful when working with Unicode digits from various scripts and numeral systems. Syntax Following is the syntax for the Char.GetNumericValue() method − public static double GetNumericValue(char ch); Parameters ch − A Unicode character to convert to its numeric value. Return Value The method returns a double representing the numeric value of the character. If the character does not represent a numeric digit, it returns -1. ...

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

Char.GetUnicodeCategory(String, Int32) Method with Examples in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 273 Views

The Char.GetUnicodeCategory(String, Int32) method in C# categorizes the character at the specified position in a specified string into a group identified by one of the UnicodeCategory values. This method is useful for determining the type of character (letter, digit, punctuation, etc.) at a specific index within a string. Syntax Following is the syntax − public static System.Globalization.UnicodeCategory GetUnicodeCategory(string str, int index); Parameters str − The string to examine. index − The zero-based position of the character to categorize within the string. Return Value Returns a UnicodeCategory enumeration value that ...

Read More
Showing 2131–2140 of 8,392 articles
« Prev 1 212 213 214 215 216 840 Next »
Advertisements