暑假周记(7.29)

  1. BigInteger适合保存比较大的整形
  2. BigDecimal适合保存精度更高的浮点型(小数)
  3. //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);//除
     

posted @   夏季彼岸德  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示