Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to convert "BigInteger" into "Integer"? how to print out a BigInteger binary value?

Reply
Thread Tools

how to convert "BigInteger" into "Integer"? how to print out a BigInteger binary value?

 
 
nick
Guest
Posts: n/a
 
      10-26-2004
1. bitstring=new BigInteger("1010",2);
System.out.print(bitstring);
the print out answer will convert to decimal ,how to print out a binary value?


2.how to convert "BigInteger" into "Integer"?

thanks!
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      10-26-2004
nick wrote:
> 1. bitstring=new BigInteger("1010",2);
> System.out.print(bitstring);
> the print out answer will convert to decimal ,how to print out a binary value?


Look for the toString(int) method in the JavaDoc
for the BigInteger class.

> 2.how to convert "BigInteger" into "Integer"?


Look for the intValue() method in the JavaDoc for
the BigInteger class.

> thanks!


You're welcome. Elementary questions are more at
home in comp.lang.java.help than here (followups set) --
but even in that group, the fact that you have not
thought to consult the JavaDoc may earn you a certain
amount of well-deserved ridicule. RTFM!

--
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert from BigInteger to Hex Nanaji Java 6 05-22-2008 10:02 PM
Convert to binary and convert back to strings Harlin Seritt Python 29 02-24-2007 09:33 AM
how to convert BigInteger to integer varma.chiru@gmail.com Java 1 11-29-2006 04:13 PM
how to convert BigInteger to integer varma.chiru@gmail.com Java 1 11-29-2006 03:32 PM
how to convert "BigInteger" into "Integer"? how to print out a BigInteger binary value? nick Java 0 10-26-2004 08:18 AM



Advertisments