AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 220 of 840

BitConverter.ToBoolean() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 213 Views

The BitConverter.ToBoolean() method in C# returns a Boolean value converted from the byte at a specified position in a byte array. This method reads a single byte and returns true if the byte is non-zero, or false if the byte is zero. Syntax Following is the syntax − public static bool ToBoolean(byte[] value, int startIndex); Parameters value − An array of bytes. startIndex − The starting position within the byte array. Return Value Returns true if the byte at startIndex in the array is non-zero; otherwise, false. ...

Read More

Int64.CompareTo Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 279 Views

The Int64.CompareTo() method in C# is used to compare the current long instance with a specified object or Int64 value and returns an integer indicating their relative values. This method is essential for sorting operations and value comparisons. Syntax The Int64.CompareTo() method has two overloads − public int CompareTo(long value); public int CompareTo(object value); Parameters value − In the first overload, it's a long integer to compare. In the second overload, it's an object to compare, which must be null or an instance of Int64. Return Value The method ...

Read More

Boolean.CompareTo(Boolean) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 671 Views

The Boolean.CompareTo(Boolean) method in C# is used to compare the current Boolean instance with another Boolean object and returns an integer indicating their relative values. Syntax Following is the syntax − public int CompareTo(bool value); Parameters value − A Boolean object to compare with the current instance. Return Value The method returns an integer value − -1 − if the current instance is false and value is true 0 − if the current instance and value are equal 1 − if the current instance ...

Read More

Math.Exp() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 357 Views

The Math.Exp() method in C# returns e (Euler's number, approximately 2.718) raised to the specified power. This method is commonly used in mathematical calculations involving exponential functions, growth calculations, and scientific computations. Syntax Following is the syntax for the Math.Exp() method − public static double Exp(double d) Parameters d − A double-precision floating-point number representing the power to which e is raised. Return Value Returns a double value representing ed. Special cases include: If d equals Double.NaN, the method returns NaN. If ...

Read More

Math.Floor() Method in C#

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

The Math.Floor() method in C# returns the largest integral value that is less than or equal to the specified number. It rounds down to the nearest integer, which is particularly important to understand when working with negative numbers. Syntax The Math.Floor() method has two overloads − public static decimal Floor(decimal val); public static double Floor(double val); Parameters val − A decimal or double number to be rounded down to the nearest integer. Return Value Returns the largest integer less than or equal to val. The return type ...

Read More

Boolean.CompareTo(Object) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 167 Views

The Boolean.CompareTo(Object) method in C# compares the current Boolean instance to a specified object and returns an integer that indicates their relationship to one another. This method is useful for sorting Boolean values or implementing custom comparison logic. Syntax Following is the syntax − public int CompareTo(object obj); Where obj is an object to compare to this instance, or null. Return Value The method returns an integer value indicating the relationship between the current instance and the specified object − Less than zero: This instance is false and obj is ...

Read More

Decimal.Multiply() Method in C#

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

The Decimal.Multiply() method in C# is used to multiply two specified decimal values and returns the result as a decimal. This method provides a safe way to perform decimal multiplication while maintaining precision and handling potential overflow conditions. Syntax Following is the syntax − public static decimal Multiply(decimal val1, decimal val2); Parameters val1 − The first decimal value (multiplicand). val2 − The second decimal value (multiplier). Return Value Returns a decimal value that represents the product of val1 and val2. Using Decimal.Multiply() for Basic ...

Read More

Decimal.Negate() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 771 Views

The Decimal.Negate() method in C# is used to return the result of multiplying the specified decimal value by negative one. This method effectively changes the sign of a decimal number − positive numbers become negative and negative numbers become positive. Syntax Following is the syntax − public static decimal Negate(decimal val); Parameters val − The decimal value to negate. Return Value Returns a decimal number that is equal to val multiplied by negative one (-1). If val is positive, the result is negative. If val is negative, the result ...

Read More

Byte.Equals(Object) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 165 Views

The Byte.Equals(Object) method in C# returns a value indicating whether this instance is equal to a specified object. This method compares the current byte instance with another object and returns true if they are equal, false otherwise. Syntax Following is the syntax − public override bool Equals (object obj); Parameters obj − An object to compare with this instance, or null. Return Value Returns true if obj is a byte instance and equals the value of this instance; otherwise, false. Example Let us now see an example ...

Read More

Decimal.Remainder() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 319 Views

The Decimal.Remainder() method in C# is used to calculate the remainder after dividing two Decimal values. This method performs the same operation as the modulus operator (%) but is specifically designed for decimal precision calculations. Syntax Following is the syntax − public static decimal Remainder(decimal val1, decimal val2); Parameters val1 − The dividend (the number to be divided). val2 − The divisor (the number by which to divide). Return Value Returns a decimal value representing the remainder after dividing val1 by val2. Division Operation: ...

Read More
Showing 2191–2200 of 8,392 articles
« Prev 1 218 219 220 221 222 840 Next »
Advertisements