UInt64.MaxValue : ULong « Data Types « VB.Net






UInt64.MaxValue

 
Imports System
Imports System.Text
Imports Microsoft.VisualBasic.Strings

Class MainClass
    Public Shared Sub Main()
        Dim decimalValue As Double = -1.5
        Dim integerValue As ULong 
        
        Dim decimalInteger As Double = Math.Floor(decimalValue)
        
        If decimalInteger < ULong.MaxValue AndAlso decimalInteger > ULong.MinValue Then
           integerValue = CULng(decimalValue)
           Console.WriteLine("Converted {0} to {1}.", decimalValue, integerValue)
        Else
           Dim rangeLimit As ULong
        
           If decimalInteger > ULong.MaxValue Then
              rangeLimit = ULong.MaxValue
              Console.WriteLine(rangeLimit)
           Else
              rangeLimit = ULong.MinValue
              Console.WriteLine(rangeLimit)
           End If       
        
        End If       
    End Sub
End Class

   
  








Related examples in the same category

1.Append ULong data type values to a StringBuilder object.
2.Use the Min method to return and display the smaller of two UInt64 variables.