why does BigDecimal.divide not do the same thing a...
# announcements
m
why does BigDecimal.divide not do the same thing as Java's BigDecimal.divide method
👍 1
j
This seems to have been introduced in order to resolve: https://youtrack.jetbrains.net/issue/KT-10462
But I agree with you it is an astonishing behavior
So in short the answer is: "because
BigDecimal.divide
may fail. And
/
should never fail"
m
i find myself saddened by this ...
j
Yes. But it looks like there's no good choice here. Maybe the
/
operator should not have been provided at all?
m
i'd have been OK with it throwing arithmetic exception. at least then you know you have to provide more info.