What is the most effective way to create BigInteger instance from int value?
Posted
by Roman
on Stack Overflow
See other posts from Stack Overflow
or by Roman
Published on 2010-04-15T14:15:10Z
Indexed on
2010/04/15
14:23 UTC
Read the original article
Hit count: 249
java
|biginteger
I have a method (in 3rd-party library) with BigInteger parameter:
public void setValue (BigInteger value) { ... }
I don't need 'all its power', I only need to work with integers. So, how can I pass integers to this method? My solution is to get string value from int value and then create BigInteger from string:
int i = 123;
setValue (new BigInteger ("" + i));
Are there any other (recommended) ways to do that?
© Stack Overflow or respective owner