问题描述
double v1 = 13.01;
for (int i = 0; i < 10; i++){
v1 += 13;
System.out.println(v1);
}
解决方案
double v1 = 4.5;
double v2 = 4.55;
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
double sum= b1.add(b2).doubleValue();
标签:BigDecimal,double,相加,v1,b1,b2,Double,缺失 From: https://www.cnblogs.com/ReturnOfTheKing/p/18097128