But I get 0.2059999999999999886757251488234032876789569854736328125 instead of 0.206. I though abs will returns a BigDecimal whose value is the absolute value of this BigDecimal, no ?
Can someone explain ?
Stephan van Hulst wrote:To further clarify what Paweł wrote, the value you are using to create the BigDecimal instance with is not actually -0.206, but the closest value that can be represented by the double datatype.
And this value is exactly -0.2059999999999999886757251488234032876789569854736328125.