Why (v1<<8 + v2) different from (v1<<8 | v2)?

step8 step7 at 163.com
Wed May 25 12:42:04 UTC 2022


     I run following test code:
       int v1 = 22;
       int v2 = 23;
       writeln( v1<<8 + v2 );		
       writeln( v1<<8 | v2 );

result is 0 and 5655
Why ( v1<<8 + v2 ) = 0 ?




More information about the Digitalmars-d-learn mailing list