Other way to know if your number is even or odd
Root / Programming Questions / [.]
hakkeCreated:
Although in this case, AND is probably the best way to do it, MOD will tell you if a number is a multiple and works for any number.
'Number is multiple of 3 !(NUM MOD 3) 'Number is multiple of 11 !(NUM MOD 11) 'Number is not multiple of 7 !!(NUM MOD 7) 'I think double negation works for true/false... right?If you're trying to find out if something is a multiple of a power of two, the best way is with AND though:
'Number is a multiple of 4 !(NUM AND 3) 'Number is a multiple of 8 !(NUM AND 7) 'Number is not a multiple of 64 !!(NUM AND 63)