java : shift distance for int restricted to 31 bits -


any idea why shift distance int in java restricted 31 bits (5 lower bits of right hand operand)?

http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.19

x >>> n 

i see similar question java bit operations >>> shift nobody pointed right answer

the shift distance restricted 31 bits because java int has 32 bits. shifting int number more 32 bits produce same value (either 0 or 0xffffffff, depending on initial value , shift operation use).


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -