本文共 815 字,大约阅读时间需要 2 分钟。
import java.math.BigInteger; public static void main(String[]argv) throws Exception BigIntegerbigInteger1= new BigInteger( "1000000" ); BigIntegerbigInteger2= new BigInteger( "250" ); bigInteger1=bigInteger1.add(bigInteger2); System. out .println(bigInteger1); bigInteger1=bigInteger1.subtract(bigInteger2); System. out .println(bigInteger1); bigInteger1=bigInteger1.multiply(bigInteger2); System. out .println(bigInteger1); bigInteger1=bigInteger1.divide(bigInteger2); System. out .println(bigInteger1); bigInteger1=bigInteger1.negate(); System. out .println(bigInteger1); bigInteger1=bigInteger1.pow(10); System. out .println(bigInteger1); //比较 a.compareTo(b)==-1,0,1(小于0,等于0,大于0) 转载地址:http://ablrb.baihongyu.com/