修正前 value &= !( 1 << bitnumber ) 修正後 value &= ~( 1 << bitnumber ) 解説 否定演算子 ! の結果は、0か1にしかならないので、 おそらく、NOT演算子 ~(チルダ)の誤りと思われます。