Friday, April 22, 2005

Two Identical Pices Of VB Code

Dim numIsOdd As Boolean = (num And 1)
And
Dim numIsOdd As Boolean

If num Mod 2 = 1 Then
numIsOdd True
Else
numIsOdd False
End If
They both find return True if they find num to be an odd number, but the first one is actually minutely faster.