Server Side Programming Articles

Page 867 of 2109

Int16.CompareTo() Method in C#

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

The Int16.CompareTo() method in C# is used to compare a 16-bit signed integer (short) with another value and returns an integer that indicates their relative order. This method is essential for sorting operations and determining the relationship between two Int16 values. Syntax The Int16.CompareTo() method has two overloads − public int CompareTo(short value); public int CompareTo(object value); Parameters value − A 16-bit signed integer or an object to compare with the current instance. Return Value The method returns an integer with the following meaning − ...

Read More

Decimal.ToDouble() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 195 Views

The Decimal.ToDouble() method in C# is used to convert the value of the specified Decimal to the equivalent double-precision floating-point number. This conversion is useful when you need to perform operations that require double precision or when interfacing with APIs that expect double values. Syntax Following is the syntax − public static double ToDouble(decimal val); Parameters val − The decimal number to convert to a double-precision floating-point number. Return Value A double-precision floating-point number that is equivalent to the specified decimal value. Using Decimal.ToDouble() with Small Values Let us ...

Read More

Decimal.ToInt16() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 144 Views

The Decimal.ToInt16() method in C# is used to convert the value of the specified Decimal to the equivalent 16-bit signed integer (short). This method performs truncation, discarding any fractional part of the decimal number. Syntax Following is the syntax − public static short ToInt16(decimal val); Parameters val − The decimal number to convert. Return Value Returns a 16-bit signed integer (short) that is equivalent to the decimal value after truncation. The range of short is -32, 768 to 32, 767. Using Decimal.ToInt16() with Positive and Negative Values The method ...

Read More

MathF.Round() Method in C# with Examples

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

The MathF.Round() method in C# is used to round a float value to the nearest integer or to a specified number of fractional digits. This method provides several overloads to handle different rounding scenarios and midpoint rounding behaviors. Syntax Following are the different overloads of the MathF.Round() method − public static float Round(float x); public static float Round(float x, int digits); public static float Round(float x, int digits, MidpointRounding mode); public static float Round(float x, MidpointRounding mode); Parameters x − The float number to be rounded. digits − The number of fractional ...

Read More

UInt16.ToString Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 198 Views

The UInt16.ToString() method in C# is used to convert the numeric value of the current UInt16 instance to its equivalent string representation. The UInt16 data type represents a 16-bit unsigned integer with a range from 0 to 65, 535. This method has multiple overloads that allow you to format the string representation using different format specifiers, culture-specific formatting, and format providers. Syntax Following is the syntax for the basic ToString() method − public override string ToString() Following is the syntax for ToString() with format specifier − public string ToString(string format) ...

Read More

MathF.Atanh() Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 169 Views

The MathF.Atanh() method in C# returns the hyperbolic arc-tangent of a single-precision floating-point value. The hyperbolic arc-tangent is the inverse of the hyperbolic tangent function and is defined only for values in the range (-1, 1). For values outside this range, the method returns NaN (Not a Number). The method is useful in mathematical calculations involving hyperbolic functions and inverse transformations. Syntax Following is the syntax − public static float Atanh(float val); Parameters val − A single-precision floating-point number representing the hyperbolic tangent whose inverse is to be found. Must ...

Read More

Char.IsLetterOrDigit() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 932 Views

The Char.IsLetterOrDigit() method in C# determines whether a specified Unicode character is categorized as a letter or a decimal digit. This method is useful for validating input characters, parsing strings, and filtering alphanumeric content. Syntax Following is the syntax for the Char.IsLetterOrDigit() method − public static bool IsLetterOrDigit(char ch); There is also an overloaded version that works with strings − public static bool IsLetterOrDigit(string s, int index); Parameters ch − The Unicode character to evaluate. s − A string. index − The position of the character to evaluate ...

Read More

Char.IsLower() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 386 Views

The Char.IsLower() method in C# is used to determine whether a specified Unicode character is categorized as a lowercase letter. This method is part of the System.Char class and provides a convenient way to validate character case in string processing operations. Syntax Following is the syntax for the Char.IsLower() method − public static bool IsLower(char ch); Parameters ch − The Unicode character to evaluate. Return Value Returns true if the character is a lowercase letter; otherwise, false. Using Char.IsLower() with Uppercase Characters The following example ...

Read More

Decimal.ToInt32() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 159 Views

The Decimal.ToInt32() method in C# is used to convert the value of the specified Decimal to the equivalent 32-bit signed integer. This method performs truncation, meaning it removes the fractional part without rounding. Syntax Following is the syntax − public static int ToInt32(decimal val); Parameters val − The decimal number to convert to a 32-bit signed integer. Return Value Returns an int value that represents the truncated decimal value. If the decimal has fractional digits, they are discarded (not rounded). How It Works The method truncates the decimal value ...

Read More

Decimal.ToInt64() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 199 Views

The Decimal.ToInt64() method in C# is used to convert the value of the specified Decimal to the equivalent 64-bit signed integer (long). This method truncates the decimal portion, returning only the whole number part. Syntax Following is the syntax − public static long ToInt64(decimal val); Parameters val − The decimal number to convert to a 64-bit signed integer. Return Value This method returns a long value that represents the truncated decimal value. The fractional part is discarded, not rounded. How It Works The method performs ...

Read More
Showing 8661–8670 of 21,090 articles
« Prev 1 865 866 867 868 869 2109 Next »
Advertisements