Logical nots would then work.
And youre still an inc/Dec away from the opposite.
a) Two's complement representation
and
b) Wraparound on arithmetic, which is still UB in low-level languages.
Not doesn't rely on wrap around arithmetic.
Wrap around arithmetic is only undefined for signed values.
What platform doesn't wrap around signed integers?
Just because c has some undefined behaviour, doesn't make it some natural law of the universe.
a) Two's complement representation
and
b) Wraparound on arithmetic, which is still UB in low-level languages.