Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
難読化された C コード コンテスト 2006では、sykes2.c について説明してください。
-~i == i+1「 2の補数のため」という記述があります。
-~i == i+1
誰かがなぜこれが当てはまるのか説明できますか?
-~xは に等しいx+1ため、~xに等しい(0xffffffff-x)。(-1-x)これは、2 の補数で に等しいので、-~xです-(-1-x) = x+1。
-~x
x+1
~x
(0xffffffff-x)
(-1-x)
-(-1-x) = x+1