Use the Sign(Long) method to determine the sign of a Long value and display it to the console. : Long « Data Types « VB.Net






Use the Sign(Long) method to determine the sign of a Long value and display it to the console.

   
Class Sample
   Public Shared Sub Main()
      Dim xLong1 As Long = -4

      Console.WriteLine(xLong1)
      Console.WriteLine(Test(Math.Sign(xLong1)))

   End Sub 

   Public Shared Function Test([compare] As Integer) As [String]
      If [compare] = 0 Then
         Return "equal to"
      ElseIf [compare] < 0 Then
         Return "less than"
      Else
         Return "greater than"
      End If
   End Function
End Class

   
    
    
  








Related examples in the same category

1.Long and Single NumberLong and Single Number
2.Append long data type values to a StringBuilder object.
3.Get Long MinValue
4.Is Long value signed
5.Convert long value to string 16 based
6.Convert string value to UInt64
7.And two UInt64 values
8.Use CInt to convert long to Integer