标签:main http file image rgs 技术 and out div
Java中,整形的最大范围是64位的long型整数。但是如果我们使用的整数超过了64位呢?这时候就用到了BigInteger。BigInteger内部使用int[]数组来存储足够大的整数。
public class BigIntTest {
 public static void main(String[] args) {
        BigInteger bigInteger = new BigInteger("45615146541561");
        BigInteger bigInteger2 = new BigInteger("6541315");
        BigInteger[] resBigIntegers = bigInteger.divideAndRemainder(bigInteger2);
        System.out.println("两数相除,整除结果为:" + resBigIntegers[0]  +
                           ",余数为:" + resBigIntegers[1]);
 }
}运行结果:

标签:main http file image rgs 技术 and out div
原文地址:https://www.cnblogs.com/undefined22/p/12544108.html