AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 224 of 840

Math.Tanh() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 164 Views

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 More

Type.GetMember() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 290 Views

The Type.GetMember() method in C# is used to retrieve information about specified members of the current Type using reflection. It returns an array of MemberInfo objects that represent the members matching the specified name and binding criteria. Syntax Following are the syntax variations for the Type.GetMember() method − public System.Reflection.MemberInfo[] GetMember(string name); public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr); Parameters name − A string specifying the name of the member to search for. bindingAttr − A combination of BindingFlags values that control how the search is conducted. ...

Read More

DateTime.Compare() Method in C#

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

The DateTime.Compare() method in C# is used for comparison of two DateTime instances. It returns an integer value indicating the relationship between the two dates − 0 − If date1 is later than date2 Syntax Following is the syntax for DateTime.Compare() method − public static int Compare(DateTime d1, DateTime d2); Parameters d1 − The first DateTime instance to compare d2 − The second DateTime instance to compare Return Value The method returns an integer value − Negative integer − If d1 is earlier than ...

Read More

Math.Truncate() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 753 Views

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 More

DateTime.AddMonths() Method in C#

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

The DateTime.AddMonths() method in C# is used to add the specified number of months to the value of a DateTime instance. This method returns a new DateTime object representing the date after adding the specified months, while the original DateTime remains unchanged. Syntax Following is the syntax for the DateTime.AddMonths() method − public DateTime AddMonths(int months); Parameters months − An integer representing the number of months to add. Use positive values to add months and negative values to subtract months. The value can range from -120, 000 to 120, 000. Return Value ...

Read More

DateTime.AddSeconds() Method in C#

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

The DateTime.AddSeconds() method in C# is used to add the specified number of seconds to the value of this instance. This returns a new DateTime object without modifying the original DateTime instance. Syntax Following is the syntax − public DateTime AddSeconds(double sec); Parameters sec − A double value representing the number of seconds to be added. If you want to subtract seconds, then set a negative value. The value can include fractional seconds. Return Value This method returns a new DateTime object that represents the date and time after adding the ...

Read More

DateTime.AddTicks() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 986 Views

The DateTime.AddTicks() method in C# is used to add a specified number of ticks to the value of this instance. It returns a new DateTime representing the adjusted time. A tick represents 100 nanoseconds, making this method useful for precise time calculations. Syntax Following is the syntax − public DateTime AddTicks(long ticks); Parameters ticks: A long value representing the number of ticks to add. Each tick equals 100 nanoseconds. Positive values add time, while negative values subtract time. Return Value Returns a new DateTime object whose value is the sum of ...

Read More

Int16.GetTypeCode Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 167 Views

The Int16.GetTypeCode() method in C# is used to return the TypeCode for value type Int16. This method is part of the IConvertible interface and helps identify the underlying data type at runtime. The TypeCode enumeration provides a way to categorize the data types supported by the Common Language Runtime (CLR). For Int16 values, this method always returns TypeCode.Int16. Syntax Following is the syntax − public TypeCode GetTypeCode(); Return Value This method returns TypeCode.Int16, which is the enumerated constant representing the Int16 type. Using GetTypeCode() with Int16 Values Example Let ...

Read More

Int32.CompareTo Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 295 Views

The Int32.CompareTo method in C# is used to compare the current integer instance with another integer or object and returns an indication of their relative values. This method is particularly useful for sorting operations and conditional comparisons. Syntax The Int32.CompareTo method has two overloads − public int CompareTo(int value); public int CompareTo(object value); Parameters value − An integer or object to compare with the current instance. Return Value Return Value Condition Meaning Less than zero (< 0) Current instance < ...

Read More

Decimal.FromOACurrency() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 123 Views

The Decimal.FromOACurrency() method in C# converts a 64-bit signed integer containing an OLE Automation Currency value to its equivalent decimal representation. OLE Automation Currency stores currency values as scaled integers, where the value is multiplied by 10, 000 to preserve four decimal places of precision. Syntax Following is the syntax for the Decimal.FromOACurrency() method − public static decimal FromOACurrency(long val); Parameters val: A 64-bit signed integer that contains an OLE Automation Currency value to be converted. Return Value Returns a decimal value equivalent to the OLE Automation Currency value. The returned ...

Read More
Showing 2231–2240 of 8,392 articles
« Prev 1 222 223 224 225 226 840 Next »
Advertisements