关于BigInteger的加减乘除使用
生活随笔
收集整理的这篇文章主要介绍了
关于BigInteger的加减乘除使用
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
public static void main(String[] args) {BigInteger bg1 = new BigInteger("12345678912");// int类型转BigIntegerint value = 12345678912;BigInteger bg2 = BigInteger.valueOf(value);//1.加法System.out.println(bg1.add(bg2));//2.减法System.out.println(bg1.subtract(bg2));//3.乘法System.out.println(bg1.multiply(bg2));//4.除法System.out.println(bg2.divide(bg1));System.out.println("--------------");//5.取除数和余数的数组BigInteger[] bg_arry = bg2.divideAndRemainder(bg1);for(int i=0; i< bg_arry.length; i++) {System.out.println(bg_arry[i]);}}
总结
以上是生活随笔为你收集整理的关于BigInteger的加减乘除使用的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: android打开系统前置摄像头驱动,a
- 下一篇: 插入数据的时候出现错误:Error du