BigInteger bigInteger = new BigInteger("23788888899999999999999999999")BigInteger bigInteger2 = new BigInteger( "100");
system.out.println(bigInteger);
//1.在对BigInteger进行加减乘除的时候,需要使用对应的方法,不能直接进行+-*//2。可以创建一个要操作的 BigInteger然后进行相应操作
BigInteger add = bigInteger.add(bigInteger2);System.out.println(add);//
BigInteger subtract = bigInteger.subtract(bigInteger2);System.out.println(subtract);//减
BigInteger multiply = bigInteger.multiply(bigInteger2);
System.out.println(multiply);//乘
BigInteger divide = bigInteger.divide(bigInteger2);System.out.println(divide);
BigInteger bigInteger2 = new BigInteger("100")
网友评论