equal « bigdecimal « Java Data Type Q&A





1. Why BigDecimal("5.50") not equals to BigDecimal("5.5") and how to work around this issue?    stackoverflow.com

Actually, I've found possible solution

//returns true
new BigDecimal ("5.50").doubleValue () == new BigDecimal("5.5").doubleValue ()
Of course, it can be improved with something like Math.abs (v1 - v2) < EPS to make the ...