use of Lsh and Rsh keys in windows 7 calculator
Mia Lopez
Does anyone know the function of the Lsh and Rsh keys in Windows 7 calculator when it is in Programmer's mode. One would think it's meant to shift bits left and right, but that doesn't seem to happen: sometimes nothing happens, other times I get a 'Result not defined' message in the display. Has anyone figured it out yet, is this a known bug?
While we're at it, does anyone have suggestions for a good calculator, one with a decent reference guide / user guide (windows help doesn't seem to give any hints on what any of the keys do, in any mode).
12 Answers
Lsh and Rsh do perform left and right shifts, respectively. After pressing the button, you need to specify the number of binary digits you would like to shift the number. See "What do all the buttons do?" here for more info.
It's not so much a bug as a misunderstanding of us users. (I think the programmers of Calculator had a hand in this too.)
If you are in hex mode, I found the number you type in after pressing the Lsh key is a hex number, not a decimal number.
For example, if you want to shift a bit 23 decimal places to the left, one would expect you to enter a 1, then press Lsh, then type 23. But what really happens is it gets shifted 35 bits (23h = 35 decimal.)
So, if you really want to shift 23 decimal bits the magic number to enter (after pressing the Lsh key) is 17.
I beat my head against this for a couple of hours till I accidentally hit Lsh 10 once and got a shift of 16.
A workaround is to enter the number in hex mode, switch to decimal mode, press the Lsh (or Rsh) key, enter the decimal number of bits to shift, (then = of course) then switch back to hex mode.
What a PITA.
Mark.