Math类和BigInteger:/BigDecimal类

 
 Math类:提供了简单计算的数学计算工具类
 
 1:public static Xxx abs(Xxx xx)  求绝对值
 2:public static double ceil(double a)  天花板  向上取整
 3:public static double floor(double a)  地板  向下取整
 4:public static double pow(double a, double b)  a^b  第一个数的第二个数次幂
 5:public static double random()    [0,1)随机数
 6:public static long round(double a)   四舍五入

 BigInteger:/BigDecimal
  支持任意精度的整数
 
  构造方法:
  public BigInteger(String val)
 
  普通方法:
  BigInteger不属于基本类型包装类,只可以调用方法计算,不可以使用运算符+,-,*,/计算
  +: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)
 
  BigDecimal:支持任意精度的小数  与double是一个近似值不同,BigDecimal是一个精确值

你可能感兴趣的:(BigDecimal)