这个帖子有解决办法:http://blog.csdn.net/shenshen123jun/article/details/8957421
import java.math.BigDecimal;public class Test20150515 { public static void main(String[] args) { //System.out.println(1.0-0.8); System.out.println(new BigDecimal("1.0").subtract(new BigDecimal("0.8"))); } }