现在的位置: 首页 > 综合 > 正文

大数运算法则

2019年06月09日 ⁄ 综合 ⁄ 共 459字 ⁄ 字号 评论关闭

public static void main(String[] args) { 

        BigInteger aa =new BigInteger("100");

        BigInteger bb= new BigInteger("25"); 

        BigInteger sub=aa.subtract(bb);//大整数的减

        BigInteger add=aa.add(bb);//大整数的加 

        BigInteger mul=aa.multiply(bb);//大整数的乘

        BigInteger div=aa.divide(bb);//大整数的除 

        System.out.println(sub.toString()); 
        System.out.println(add.toString());
        System.out.println(mul.toString());
        System.out.println(div.toString()); }

抱歉!评论已关闭.