VB.Net Tutorial/Data Type/Short — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:54, 26 мая 2010
MinValue and MaxValue of Short
<source lang="vbnet">public class Test
public Shared Sub Main Dim sNum As Short Console.WriteLine("Short: " & sNum.MinValue & " to " & sNum.MaxValue) End Sub
End class</source>
Short: -32768 to 32767
Short Overflow
<source lang="vbnet">Module Module1
Sub Main() Dim Value As Short = 32767 Value = Value + 1 End Sub
End Module</source>
Unhandled Exception: System.OverflowException: Arithmetic operation resulted in an overflow. at Module1.Main()