Skip to content

bigDecimalOf type cast error #293

Closed
@Zhouenze

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!

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions