943,640 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 1500
  • Java RSS
Jan 5th, 2009
0

Big binary String to a number format

Expand Post »
We can convert any kind of numbers to binary string. For example 20501487 can be converted into binary String format as 1001110001101001111101111. However I cannot reconvert this binary String into any number format, even long or float numbers due to NumberFormatException, where the numbers are very big to convert.
I couldn't find any usable method in Biginteger class. Anybody can help me to convert such a big binary numbers from string format to any number format.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
omeralper is offline Offline
14 posts
since Nov 2007
Jan 6th, 2009
1

Re: Big binary String to a number format

BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter the binary value:");
String s = br1.readLine();
System.out.println("Decimal value is : "+Integer.parseInt(s, 2));


Albert
Reputation Points: 9
Solved Threads: 2
Light Poster
AlbertPi is offline Offline
33 posts
since Nov 2008
Jan 6th, 2009
0

Re: Big binary String to a number format

Thank you very much. I miss this method!
Reputation Points: 10
Solved Threads: 1
Newbie Poster
omeralper is offline Offline
14 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: database in java
Next Thread in Java Forum Timeline: Need help very badly





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC