Convert.ToBoolean (Single) converts single-precision number to Boolean value.
Class Sample
Public Shared Sub Main()
Dim numbers() As Single = { Single.MinValue, 20e-15, 0,100.33, Single.MaxValue }
Dim result As Boolean
For Each number As Single In numbers
result = Convert.ToBoolean(number)
Console.WriteLine("{0,-15} --> {1}", number, result)
Next
End Sub
End Class
Related examples in the same category