zoukankan      html  css  js  c++  java
  • BigInteger & BigDecimal

    BigInteger   可以让超过Integer范围内的数据进行运算

      

    成员方法   加减乘除
      * public BigInteger add(BigInteger val)
      * public BigInteger subtract(BigInteger val)
      * public BigInteger multiply(BigInteger val)
      * public BigInteger divide(BigInteger val)


    * public BigInteger[] divideAndRemainder(BigInteger val)      同时返回除数和余数

    A:BigDecimal的概述
      * 由于在运算的时候,float类型和double很容易丢失精度,演示案例。
      * 所以,为了能精确的表示、计算浮点数,Java提供了BigDecimal

    * 不可变的、任意精度的有符号十进制数。
    * B:构造方法
      * public BigDecimal(String val)
    * C:成员方法
      * public BigDecimal add(BigDecimal augend)
      * public BigDecimal subtract(BigDecimal subtrahend)
      * public BigDecimal multiply(BigDecimal multiplicand)
      * public BigDecimal divide(BigDecimal divisor)

    竹杖芒鞋轻胜马,一蓑烟雨任平生。 回首向来萧瑟处,也无风雨也无晴。
  • 相关阅读:
    makefile
    xcode
    centos
    debug
    服务器开发
    socket
    xcode
    调用cpp库更基本
    nodejs cpp动态库
    html5图片裁剪法--
  • 原文地址:https://www.cnblogs.com/yaobiluo/p/11302134.html
Copyright © 2011-2022 走看看