[advanced Java interview] Why is it forbidden to use BigDecimal's equals method for equivalence comparison?

BigDecimal is a type provided by the java.math package that can be used for precise operations. For example, in scenarios such as amount representation and amount calculation, double, float and other types cannot be used, but BigDecimal with better accuracy support should be used, and many internal methods, such as addition, subtraction, mu ...

Posted by jannz on Sat, 18 Sep 2021 15:02:53 -0700