<Strange BigDecimal result> Hello friends, I am a ...
# forum
r
Strange BigDecimal result Hello friends, I am a bit confused at this behavior of BigDecimal, maybe someone has insight. When I compare: java.math.BigDecimal(0) == java.math.BigDecimal(0.00) // true However, when I compare: java.math.BigDecimal(0) == (0.00).toBigDecimal() // false Why is there a difference when converting from Double? I see that the standard library first converts double to String before making it a BigDecimal. Can this be why? And why convert it to String first?? 1 post - 1 participant...