If test doesn't recognize zero

if (inputs & x ==0)

== has higher precedence than & which means that the above is equivalent to

if (inputs & (x ==0))

Try

if ((inputs & x) ==0)