When you call method calls for BigDecimal , the order of operations is not preserved, as in mathematics, and as with double operators in Java. Methods will be executed in order. This means that b.subtract(b) is executed first, which results in BigDecimal 0 .
To get an equivalent result, follow the order of operations by sending the result of the divide method to the subtract method.
System.out.println(b.subtract( b.divide(new BigDecimal(1.05)) ).doubleValue());
source share