Int16.MinValue Field


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Represents the smallest possible value of Int16. This field is constant.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

Public Const MinValue As Short

Field Value

Type: System.Int16

The value of this constant is -32768; that is, hexadecimal 0x8000.

The MinValue property is typically used to prevent an OverflowException when converting from a numeric type with a greater lower range (such as an Int32 or an Int64) to an Int16. The example illustrates this usage.

The following example uses the MinValue property to prevent an OverflowException when converting to an Int16 value.

Dim numbersToConvert() As Long = {162345, 32183, -54000}
Dim newNumber As Int16
For Each number As Long In NumbersToConvert
   If number >= Int16.MinValue And number <= Int16.MaxValue Then
      newNumber = Convert.ToInt16(number)
      Console.WriteLine("Successfully converted {0} to an Int16.", _
      Console.WriteLine("Unable to convert {0} to an Int16.", number)
   End If                     
' The example displays the following output to the console:
'       Unable to convert 162345 to an Int16.
'       Successfully converted 32183 to an Int16.
'       Unable to convert -54000 to an Int16.   

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top