Hi Jeremy. I guess your problem is the size of long. It has 64 bits and not only the 32 bits you are using. If you change your program to: n = 0xf0f0f0f0L; it should work. If you don't do this, higher bits get set to 1 and the output of your program is right (although it does not show these higher bits...) Try using: System.out.println(Long.toBinaryString(n>>x)); instead of calling dprint. Hope this helps! -- Cassino
- Bitwise operators Azazel
- Re: Bitwise operators Juergen Kreileder
- Re: Bitwise operators Carlos Cassino
- Re: Bitwise operators Carlos Cassino
- Re: Bitwise operators Dirk Vanhalle