Forums Register Login

Question on Integer.toBinaryString (maybe)

+Pie Number of slices to send: Send
Here is the code,which I wrote to figure out sign(and unsign) concept.

After compiling
I got
11110111111100011101011111001011
11111011111110001110101111100101
11111101111111000111010111110010
11111110111111100011101011111001
11111111011111110001110101111100
11111111101111111000111010111110
11111111110111111100011101011111
11111111111011111110001110101111
11111111111101111111000111010111
11111111111110111111100011101011
11111111111111011111110001110101
11111111111111101111111000111010
11111111111111110111111100011101
11111111111111111011111110001110
11111111111111111101111111000111
11111111111111111110111111100011
11111111111111111111011111110001
11111111111111111111101111111000
11111111111111111111110111111100
11111111111111111111111011111110
11111111111111111111111101111111
11111111111111111111111110111111
11111111111111111111111111011111
11111111111111111111111111101111
11111111111111111111111111110111
11111111111111111111111111111011
11111111111111111111111111111101
11111111111111111111111111111110
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11111111111111111111111111111111
11110111111100011101011111001011

My question is
Is there any way that I can see the 33 results directly
in integer form by adding some words?
Simply speaking,how do I translate some strings like
(11111011111110001110101111100101) to integer?
Thanks for your answer.
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ March 15, 2004: Message edited by: Dirk Schreckmann ]
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
You can try what Jean suggested or you can try this

If you need to obtain other bases, consider changing 2 to 8 for Octal or 16 for Hex ...etc.
[ March 15, 2004: Message edited by: Vicken Karaoghlanian ]
+Pie Number of slices to send: Send
Welcome to JavaRanch, ravel chen!
I've very happy that some fellow ranchers have already helped to point you in the right direction for solving your problem. I'm posting just to suggest a simple tip to help improve communications in these forums.
When posting code, please be sure to surround the code with the [code] and [/code] UBB Tags. This will help to preserve the formatting of the code, thus making it easier to read and understand.
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1512 times.
Similar Threads
Integer and Short
~ question required
Binary Representation of integers
shift opeartors - need help
Shift Operators
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:03:25.