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