4 ms·
The output of "Problem 1" can actually be "yes", depending on the architecture. -1 is "all bits set" on two's complement signed integers but that's not the only
by henkie 15y ago
The output of "Problem 1" can actually be "yes", depending on the architecture. -1 is "all bits set" on two's complement signed integers but that's not the only integer encoding in existence. If you want "all bits set", write ~0. That's exactly all bits set and defined behaviour you can rely on in a portable program as opposed to an implementation detail.