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 850 of 2109
Math.IEEERemainder() Method in C#
The Math.IEEERemainder() method in C# returns the remainder resulting from the division of a specified number by another specified number. Unlike the modulus operator (%), this method follows the IEEE 754 standard for floating-point arithmetic, which can produce different results in certain cases. The IEEE remainder is calculated as dividend - (divisor * Math.Round(dividend / divisor)), where the division result is rounded to the nearest even integer when exactly halfway between two integers. Syntax public static double IEEERemainder(double dividend, double divisor); Parameters dividend − A double-precision floating-point number (the number to be ...
Read MoreMath.Log() Method in C#
The Math.Log() method in C# is used to return the logarithm of a specified number. This method provides two overloads: one for calculating the natural logarithm (base e) and another for calculating logarithm with a specified base. Syntax Following are the two overloads of the Math.Log() method − public static double Log(double num) public static double Log(double num, double newBase) Parameters num − The number whose logarithm is to be calculated (must be positive for real results). newBase − The base of the logarithm (must be positive and not equal to 1). ...
Read MoreMath.Log10() Method in C#
The Math.Log10() method in C# calculates the base-10 logarithm of a specified number. This method is particularly useful in mathematical calculations, scientific computations, and when working with exponential data that needs to be converted to a logarithmic scale. Syntax Following is the syntax for the Math.Log10() method − public static double Log10(double d); Parameters d − A double-precision floating-point number whose base-10 logarithm is to be found. Return Value The Log10() method returns different values based on the input parameter − Input Parameter (d) Return Value ...
Read MoreChar.TryParse() Method in C#
The Char.TryParse() method in C# is used to convert a string representation to its equivalent Unicode character. This method returns true if the conversion succeeds, or false if it fails, making it a safe alternative to Char.Parse() which throws exceptions on invalid input. The method only succeeds if the input string contains exactly one character. Multi-character strings, empty strings, or null values will cause the method to return false. Syntax Following is the syntax for the Char.TryParse() method − public static bool TryParse(string str, out char result); Parameters str − ...
Read MoreDictionary.Count Property in C#
The Dictionary.Count property in C# gets the number of key/value pairs contained in the Dictionary. This property is read-only and provides an efficient way to determine the size of your dictionary collection. Syntax public int Count { get; } Return Value The property returns an int representing the total number of key/value pairs in the dictionary. The count is automatically updated when items are added or removed. Using Dictionary.Count Property Basic Usage Example The following example demonstrates how to use the Count property to track dictionary size − using ...
Read MoreCharEnumerator.MoveNext() Method in C#
The CharEnumerator.MoveNext() method in C# advances the internal index of the current CharEnumerator object to the next character of the enumerated string. It returns true if the enumerator successfully moved to the next character, or false if it has passed the end of the string. Syntax public bool MoveNext(); Return Value The method returns a bool value − true − if the enumerator was successfully advanced to the next character false − if the enumerator has passed the end of the string ...
Read MoreCharEnumerator.Reset() Method in C#
The CharEnumerator.Reset() method in C# initializes the enumerator's position to logically before the first character of the enumerated string. This method is useful when you need to restart enumeration from the beginning after having already iterated through the string. Syntax Following is the syntax for the CharEnumerator.Reset() method − public void Reset(); Parameters This method takes no parameters. Return Value This method does not return any value (void). How It Works When you call Reset(), the enumerator's internal position is moved to before the first character. After calling Reset(), ...
Read MoreMath.Tanh() Method in C#
The Math.Tanh() method in C# returns the hyperbolic tangent of a specified angle. The hyperbolic tangent function is commonly used in mathematical calculations, especially in calculus and engineering applications. Unlike the regular tangent function which deals with circular trigonometry, the hyperbolic tangent operates on hyperbolic angles. Syntax Following is the syntax for the Math.Tanh() method − public static double Tanh(double value); Parameters The method accepts the following parameter − value − A double representing the angle in radians for which to calculate the hyperbolic tangent. Return Value ...
Read MoreMath.Truncate() Method in C#
The Math.Truncate() method in C# is used to remove the fractional part of a number and return only the integral part. It works with both decimal and double data types, effectively cutting off all digits after the decimal point without rounding. Syntax The Math.Truncate() method has two overloads − public static decimal Truncate(decimal d) public static double Truncate(double d) Parameters d − A decimal or double number to truncate. Return Value Returns the integral part of the specified number. The return type matches the input parameter type (decimal returns ...
Read MoreCharEnumerator.ToString() Method in C#
The CharEnumerator.ToString() method in C# returns a string representation of the current CharEnumerator object. This method is inherited from the Object class and provides basic type information about the enumerator instance. Syntax Following is the syntax − public override string ToString(); Return Value The method returns a string that represents the current object. For CharEnumerator, this typically returns the fully qualified type name "System.CharEnumerator". Using CharEnumerator.ToString() Method Example Let us see an example to implement the CharEnumerator.ToString() method − using System; public class Demo { ...
Read More