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)

    竹杖芒鞋轻胜马,一蓑烟雨任平生。 回首向来萧瑟处,也无风雨也无晴。
  • 相关阅读:
    HDU 1261 字串数(排列组合)
    Codeforces 488C Fight the Monster
    HDU 1237 简单计算器
    POJ 2240 Arbitrage
    POJ 3660 Cow Contest
    POJ 1052 MPI Maelstrom
    POJ 3259 Wormholes
    POJ 3268 Silver Cow Party
    Codesforces 485D Maximum Value
    POJ 2253 Frogger(最短路)
  • 原文地址:https://www.cnblogs.com/yaobiluo/p/11302134.html
Copyright © 2011-2022 走看看