Are (bool)(i & 1) and i % 2 == 1 same?

Viewed 3461

Are (bool)(i & 1) and i % 2 == 1 always same where i is int?

Note: saying always I mean for all platforms (even when a byte is 16 bit) and for all standards of C and C++.

Edit:

For all standards of C and C++ where bool exist.

2 Answers
Related