Originally posted by Paul Clapham: And also, if the rightmost bit of a binary integer is 1, that means it's an odd integer, not that it's a negative integer.
You mean leftmost, surely.
BTW: If you get a binary String with the Integer.toBinaryString() methods, it excludes leading 0s, so it always has 1 as the leftmost displayed digit. You will have to use a for loop and the insert method of StringBuilder (or similar) to pack it with 0s from the left.
For always has 1 read "almost always has 1" The value of 0 wouldn't have a 1 in![/edit] [ January 30, 2008: Message edited by: Campbell Ritchie ]
Joined: Jan 30, 2000
[PC]: And also, if the rightmost bit of a binary integer is 1, that means it's an odd integer, not that it's a negative integer.
[CR]: You mean leftmost, surely.
I'm pretty sure he meant rightmost. Leftmost is what Sunny should have said, but rightmost is what he did say. Paul was commenting on that.
Originally posted by Sunny Jain: Ohh I am sorry, What I meant was left most bit..!! Being a left handed person i often got confusion regarding that..! as My left is actually my right hand..but for other it is left hand..!!
Good that the confusions are resolved earlier here. Also i believe it does not make any confusions wiht L-R , R-L associativities