特大整型相加求和、差值,

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wanggeying/article/details/85011600

特大整型相加求和、差值,比如:int ii=70000000000,这种情况下用int进行求和、求差值就不行了, 会出现出错

解决方案:

                    BigInteger dykszh_count = new BigInteger(dykszh.substring(2,dykszh.length()));
                    BigInteger dyjszh_count = new BigInteger(dyjszh.substring(2,dyjszh.length()));
                    BigInteger dyzh_cha=dyjszh_count.subtract(dykszh_count);

猜你喜欢

转载自blog.csdn.net/wanggeying/article/details/85011600