in assembly this is VERY easy:
Code: Select all
rrca
jp c, odd
jp nc, even
Code: Select all
if (newint and -2)=0 then even() else odd()
EDIT: I have a strong suspicion that it will convert newint and -2 to booleans and then compare them, wich obvious most of the time (always?) gives 0... Any trick to get around that?
EDIT2: My very stupid work around:
Code: Select all
Public Function CheckBit0(ByVal nr As Integer) As Integer
Math.DivRem(nr, 2, CheckBit0)
End Function