Closed
Description
Hi there,
I've found following issue with bigDecimalOf
code:
@Test
fun typeCastIssue() {
val zero = BigDecimal.ZERO
println(zero == Decimal.NEGATIVE_ZERO) // true
bigDecimalOf(zero) // throw exception
}
Seems like the when condition here is an equivalence test, not asserting same object. So if num = BigDecimal.ZERO
, then it enters this branch and fail type cast.
Could you take a look? Thanks!