Server Side Programming Articles

Page 861 of 2109

Byte.MaxValue Field in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 357 Views

The Byte.MaxValue field in C# represents the largest possible value that can be stored in a byte data type. Since a byte is an 8-bit unsigned integer, it can hold values from 0 to 255, making Byte.MaxValue equal to 255. This constant field is particularly useful when you need to validate input ranges, initialize arrays with maximum values, or perform boundary checks in your applications. Syntax Following is the syntax for the Byte.MaxValue field − public const byte MaxValue = 255; Using Byte.MaxValue for Range Validation Example using System; ...

Read More

Byte.MinValue Field in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 163 Views

The Byte.MinValue field in C# represents the smallest possible value that a byte data type can hold. Since byte is an unsigned 8-bit integer, its minimum value is always 0. Syntax Following is the syntax for accessing the Byte.MinValue field − public const byte MinValue = 0; The field is accessed as − byte minValue = Byte.MinValue; Understanding Byte Range The byte data type in C# is an unsigned 8-bit integer that can store values from 0 to 255. The Byte.MinValue constant provides the lower bound of this range. ...

Read More

Byte.ToString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 113 Views

The Byte.ToString() method in C# converts the value of the current Byte object to its equivalent string representation. This method is inherited from the Object class and overridden to provide byte-specific string conversion. Syntax Following is the syntax for the basic ToString() method − public override string ToString(); The Byte class also provides overloaded versions that accept format specifiers − public string ToString(string format); public string ToString(IFormatProvider provider); public string ToString(string format, IFormatProvider provider); Using Basic ToString() Method The parameterless ToString() method converts a byte value to its decimal ...

Read More

DateTime.ToOADate() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 856 Views

The DateTime.ToOADate() method in C# is used to convert a DateTime instance to its equivalent OLE Automation date. OLE Automation dates are represented as double-precision floating-point numbers where the integer part represents the number of days since December 30, 1899, and the fractional part represents the time of day. Syntax Following is the syntax − public double ToOADate(); Return Value Returns a double representing the OLE Automation date equivalent of the current DateTime instance. How It Works OLE Automation dates use a specific format where: Integer part: Number ...

Read More

DateTime.ToShortDateString() Method in C#

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

The DateTime.ToShortDateString() method in C# is used to convert the value of the current DateTime object to its equivalent short date string representation. This method formats the date according to the current culture's short date pattern, excluding the time portion. Syntax Following is the syntax − public string ToShortDateString(); Return Value This method returns a string that represents the short date value of the current DateTime object. The format depends on the current culture's DateTimeFormatInfo.ShortDatePattern property. Using ToShortDateString() with Specific DateTime Example using System; public class Demo { ...

Read More

Int16.Equals Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 209 Views

The Int16.Equals() method in C# is used to return a value indicating whether this instance is equal to a specified object or Int16. This method provides two overloads − one for comparing with another Int16 value and another for comparing with any object. Syntax Following is the syntax for both overloads − public bool Equals(short ob); public override bool Equals(object ob); Parameters For the first overload − ob − An Int16 value to compare to this instance. For the second overload − ob − The object to ...

Read More

Math.Round() Method in C#

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

The Math.Round() method in C# rounds a value to the nearest integer or to the specified number of fractional digits. This method provides several overloads to handle different data types and rounding scenarios. Syntax The following are the primary syntax forms of Math.Round() − Math.Round(Double) Math.Round(Double, Int32) Math.Round(Double, Int32, MidpointRounding) Math.Round(Double, MidpointRounding) Math.Round(Decimal) Math.Round(Decimal, Int32) Math.Round(Decimal, Int32, MidpointRounding) Math.Round(Decimal, MidpointRounding) Parameters value − The decimal or double number to be rounded. digits − The number of fractional digits in the return value. mode − Specification for how to round value if it ...

Read More

Math.Sign() Method in C#

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

The Math.Sign() method in C# is used to return an integer that indicates the sign of a number. It returns +1 for positive numbers, -1 for negative numbers, and 0 for zero. Syntax The Math.Sign() method has multiple overloads to handle different numeric types − public static int Sign(sbyte value); public static int Sign(short value); public static int Sign(int value); public static int Sign(long value); public static int Sign(float value); public static int Sign(double value); public static int Sign(decimal value); Return Value The method returns an int value − -1 if ...

Read More

Math.Sin() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 827 Views

The Math.Sin() method in C# is used to return the sine of a specified angle. The method accepts an angle in radians and returns a double value representing the sine of that angle. Syntax Following is the syntax for the Math.Sin() method − public static double Sin(double val); Parameters val − A double value representing an angle in radians. Return Value The method returns a double value representing the sine of the specified angle. The return value ranges from -1 to 1. For special cases − ...

Read More

Math.Sinh() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 122 Views

The Math.Sinh() method in C# calculates the hyperbolic sine of a specified angle in radians. The hyperbolic sine function is defined mathematically as (ex - e-x)/2, where e is Euler's number (approximately 2.71828). This method is commonly used in mathematical calculations involving hyperbolic functions, engineering applications, and scientific computations. Syntax Following is the syntax of the Math.Sinh() method − public static double Sinh(double value) Parameters value: A double-precision floating-point number representing an angle in radians for which the hyperbolic sine is to be calculated. Return Value Returns a double representing ...

Read More
Showing 8601–8610 of 21,090 articles
« Prev 1 859 860 861 862 863 2109 Next »
Advertisements