Create BigInteger from arbitrary radix in Java
Description
The following code shows how to create BigInteger from arbitrary radix.
Example
/*from w w w . java 2 s . c o m*/
import java.math.BigInteger;
public class Main {
public static void main(String[] argv) throws Exception {
int radix = 32;
BigInteger bi = new BigInteger("vv", radix);
String s = bi.toString(radix);
System.out.println(s);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »