new BigDecimal(double) vs new BigDecimal(String) [duplicate]
问题 This question already has answers here : BigDecimal from Double incorrect value? (3 answers) Convert double to BigDecimal and set BigDecimal Precision (8 answers) Closed 4 years ago . When BigDecimal is used with an input of double and BigDecimal with an input of String different results seem to appear. BigDecimal a = new BigDecimal(0.333333333); BigDecimal b = new BigDecimal(0.666666666); BigDecimal c = new BigDecimal("0.333333333"); BigDecimal d = new BigDecimal("0.666666666"); BigDecimal x