BigDecimal 类
11.10 BigDecimal 类
【例 11.35】验证 Biginteger
package jiaqi;
import java.math.BigInteger;
public class demo346_1 {
public static void main(String[] args)
{
BigInteger bi1 = new BigInteger("100000000000000000");
BigInteger bi2 = new BigInteger("500000000000000001");
System.out.println(bi2.add(bi1));
System.out.println(bi2.subtract(bi1));
System.out.println(bi2.multiply(bi1));
System.out.println(bi2.divide(bi1));
System.out.println(bi2.max(bi1));
System.out.println(bi2.min(bi1));
BigInteger ans[] = bi2.divideAndRemainder(bi1);
System.out.println("商="+ans[0]+"\t"+"余数"+ans[1]);
}
}