First, enter:
Output:
Use new BigDecimal (), accuracy problems
Second, enter:
Output:
new BigDecimal (), the first will be converted to Double String, resolve
Third, enter:
Output:
Use BigDecimal.valueOf (), no accuracy problems
Summary: To solve the problem of progress that can occur when doing arithmetic Double, Double will be converted to BigDecimal do arithmetic, conversion method is best to use BigDecimal.valueOf ().