java大数取余

java大数取余:

类方法:BigInteger.divideAndRemainder()

返回一个数组,key = 0为商key = 1为余数

import java.util.*;
import java.math.*;
public class Main{

    public static void main(String[] args) {
        BigInteger num=BigInteger.valueOf(13);
        BigInteger num1[] = //remermber
                num.divideAndRemainder((BigInteger.valueOf(7)));
        System.out.println(num1[1]);
    }

}
原文地址:https://www.cnblogs.com/langyao/p/7251907.html