Can you tell me why least significant "5" bits of the integer value -2 are used?
Thanks,<br />Lakshmi.
Originally posted by Lakshmi Saradha:
I think it will go about in this manner.
-2 binary representation is
11111111 11111111 11111111 00000010
If I am wrong in any place, please correct me.
toBinaryString
public static String toBinaryString(int i)
Returns a string representation of the integer argument as an unsigned integer in base 2.
The unsigned integer value is the argument plus 2^32 if the argument is negative; otherwise it is equal to the argument. This value is converted to a string of ASCII digits in binary (base 2) with no extra leading 0s.
Thanks,<br />Lakshmi.
Originally posted by Lakshmi Saradha:
Thank you hariwinder for pointing the wrong binary representation.
BTW, Any idea of whether we can take a calculator for the exam?
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Originally posted by Bert Bates:
(and I got a shovel blade and a piece of charcoal for my exam, plus it was snowing and uphill both ways)
Paper jam tastes about as you would expect. Try some on this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|