Issue with bit shifting

10-11  Source: Network gathering  Views:0 

Advertisement
Hi everyone!
I have a question about bit shifting. When I attempt to shift 32 bit on a int value, the output is the same value. It doesn't matter if I try to make a rigth or left shifting. It also hapend when I make 64 bit shifting on a long value. I supposed it should be 0. This is the code I'm woking with:
int x = 2147483647;
System.out.println("Output1 = " + (x >> 32));
System.out.println("Output2 = " + (x << 32));
Output:
Output1 = 2147483647
Output2 = 2147483647
Could someone help me to understand why this happend?
Thanks in advance.
GerSua wrote:
Hi everyone!
I have a question about bit shifting. When I attempt to shift 32 bit on a int value, the output is the same value. It doesn't matter if I try to make a rigth or left shifting. It also hapend when I make 64 bit shifting on a long value. I supposed it should be 0. This is the code I'm woking with:
int x = 2147483647;
System.out.println("Output1 = " + (x >> 32));
System.out.println("Output2 = " + (x << 32));
Output:
Output1 = 2147483647
Output2 = 2147483647
Could someone help me to understand why this happend?
Thanks in advance.It is supposed to work this way. I know that's not alot of info, but you have not discovered a bug or anything like that.
Related articles
  • Issue with bit shifting 10-11

    Hi everyone! I have a question about bit shifting. When I attempt to shift 32 bit on a int value, the output is the same value. It doesn't matter if I try to make a rigth or left shifting. It also hapend when I make 64 bit shifting on a long value. I

  • Problems with bit shift left in Formula Node 11-30

    Hi, Sorry but my English is not good. I'm trying to execute a bit shift left in the Formula Node, but the shift left is not working as I expected. uInt32 parametro[5]; float32 valorAmostra; int16 indiceAmostra; uInt8 indiceResposta; int16 controle; i

  • Issue with Rotational Shifts 11-30

    Dear Expert, We have 3 shifts in plants for labors. But 75% there is a fluctuation of their daily working timing. Like employee planned working time is 08:00 to 04:00. he will work this week in this timing. But as per work load,he will work in other

  • Bit Shifting Help 10-11

    Hi, I'm not too familiar with bit shifting. If anyone can help with this problem, it would be great! We have words that are 32 bits. So, basically, the lower 8 bits should have value �1� and the upper 24 bits should have value �X�. For our example, l

  • Alignment issues with menu widget and added web safe fonts 11-30

    I wanted to use a font that was not already on the web safe list so I added one. I have a background rectangle I drew in muse for the main navigation to center on. In muse, I have to shift the menu almost entirely off the rectangle for it to appear c

  • Issues with itunes 10.5 on Windows 7 (32 Bit) When Trying to sync iphone 4S or older 10-11

    I see a lot of people out there, specifically windows OS owners (xp all the way to 7), having issues with iTunes 10.5.  Here are the following issues I've encountered (some may only have one problem, others my have a combo pack of problems). 1. iphon

  • Performance Issues with Photoshop CS6 64-Bit 10-11

    Hello - Issue at hand: over the course of the last few weeks, I have noticed significant issues with performance since the last update to PS CS6 via the Adobe Application Manager, ranging from unexpected shut downs to bringing my workstation to a cra

  • IS there a way to fix the issue with text list boxes where they shift (empty space is smaller than the text size) when two text lsit boxes are side by side? 10-11

    Currently I have a webpage I designed for a company where I have multiple text list boxes side by side for the purpose of displaying data in each one based on a category in the database. So a text list box for the primary key, name, serial number, et

  • Library issues with Windows 7 (64 Bit) 10-11

    I have just upgraded to a new computer and have had enormous issues with I tunes 64 bit for Windows 7. I had my music on another disc which I have mounted into the new computer. It is the same drive name (D) as on my old computer (Windows XP 32 bit).

  • Memory Leak Issue With Win7 64 bit and Youtube. 10-11

    I have a Win7 64 bit using IE9 with version 11.4.402.265 installed. 4 MB installed. Whenever I go to Youtube or Liveleak, and watch videos, over time it uses up to 4gigs of my memory! Even if I close the window, it does not free up the memory until I

  • Windows 8 64 bit issues with Cisco AnyConnect Secure Mobility Client version 3.1.04072 10-11

    I am having an issue with the Cisco AnyConnect Secure Mobility Client version 3.1.04072 on a Windows 8 64 bit laptop. I am able to create the VPN connection but the connection will not allow data to be transferred. Stats from a manual connection: Cis

  • ImageFORMULA P-215 Scan-tini Software Issues with Windows 8.1 32-Bit Laptop 10-11

    Hi,, I have a ImageFORMULA P-215 Scan-tini scanner which worked without any problems with my Lenovo X230 laptop running Windows 7 64-bit.  However, I have been unable to get the CaptureOn Touch software to work on my Asus Transformer TA100T notebook

  • Labview 2012 Installer builder issues with Windows 7 64 bit 10-11

    I have a clients project application program I am working on and am having a lot of trouble getting installed applications to work on Windows 7 properly. The Labview Installer sets the default installation directory to "c:\Program Files\" on Win

  • Shift+i issue with Dreamweaver CS4 10-11

    Hi, i have an issue with Dreamweaver CS4 when I press shift+i the behavior is similar as cmd+v (a paste action). I checked the keyboard shortcut, but no action set for shift+i .. i don't understand. Please may you help me!? thanks bye MaxAnother plac

  • Issue with Acrobat 10.1.2 and Windows 7 64-bit Preview Handler 10-11

    Hi. I work in an enterprise environment that is currently migrating to  64-bit Windows 7. The only version of Acrobat we have approved for Windows 7 is 10.1.2. We're seeing an issue with this version that causes the preview handler to not work. The p

  • Facing issues with oracle client installation 32 bit 10.2.0.1 11-30

    Hi , I am facing issues with oracle client installation 32 bit 10.2.0.1 Windows 2008 R2 enterprise edition 64 bit Java 1.6 update 34 Below is the error recieved: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8079055 Fun

  • SAP GUI Compatibility issue with Windows 2008R2 64 Bit 10-11

    Hi Gurus Is anyone experienced connectivity issue with SAP GUI (32bit)  on Windows 2008R2 64bit? Except base version of 7.3 every Service Pack failing to connect, Strange thing was it was working with SP5 in WINDOWS 7 64bit. Your inputs greatly appre

  • ITunes and iPhone 4 sync issues with Windows 7 64 bit 10-11

    I am getting several errors with sync'ing iTunes to my iPhone on windows7 64bit. I reinstalled iTunes, I did a repair on iTunes, even tried a RESTORE on iPhone, but it gives me so many errors one after another after another. 1. Some of the items were

  • ITunes sync issues with Windows 7 64k Bit 10-11

    I am beyond frustrated! I have attempted for the past 3 days straight to figure out why iTunes keeps having syncing issues with all my devices- Nano 8GB, Touch 8GB, iPhone 3G 8GB. When I first connected the devices for the first time iTunes froze up

  • Having 2 small issues with 10.4.3 interface - shift click & control click 10-11

    I am having two issues with 10.4.3 on my mom's computer. 1) I Control-Click the mouse and I do get a shortcut menu on the desktop, on icons, etc. How can I get this back? I can not seem to find a preference that sets this. 2) I am in iPhoto and would