标签:
import java.math.BigDecimal; public class Test { public static void main(String[] args) { BigDecimal a = new BigDecimal("1"); BigDecimal b = new BigDecimal("2"); BigDecimal c = new BigDecimal("3"); BigDecimal d = new BigDecimal("4"); //加法操作a+b System.out.println(a.add(b)); //乘法操作b*c System.out.println(b.multiply(c)); //减法操作d-a System.out.println(d.subtract(a)); //除法操作d/b System.out.println(d.divide(b)); //乘方操作d的2次方 System.out.println(d.pow(2)); } }
现在先写这么多吧,以后用的其他功能再慢慢补上~~
标签:
原文地址:http://www.cnblogs.com/hnzyyTl/p/4811975.html