• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on Integer.toBinaryString (maybe)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Quick! Before anybody notices! Cover it up with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic