gcc bitwise Leftshift (<<) strange behavior. Here is my code:
gcc
<<
#include #include void foo(in
I finally figure out a work-around solution, at least make the output identical.
#include #include void foo(int n){ printf("1<<32:%d\n", 1<<32); printf("1<<(32-n):%d\n", (1<<(31-n))<<1); } int main(){ foo(0); }