I've never used Modulus before but shouldn't
if (x % 2 == 0)
work?
EDIT: Sorry, I'm tired don't mind me being stupid and all.
EDIT 2: Let me try that again.
if ((x & x*-1) == x)
Problem is, this isn't any better than your version or anything. But I just wanted to clean my name.
if (x % 2 == 0)
work?
EDIT: Sorry, I'm tired don't mind me being stupid and all.
EDIT 2: Let me try that again.
if ((x & x*-1) == x)
Problem is, this isn't any better than your version or anything. But I just wanted to clean my name.