Why doesn't Scala's BigDecimal have a ZERO?
If I had to guess, it's because the expected way to get that value would be like this:
val zero: BigDecimal = 0
I'd think it's because usually you don't need it. Whereas in Java you need to type something like
BigDecimal b = new BigDecimal(1.23).add(BigDecimal.ZERO);
in Scala, there are number conversions that mean you can write
val b = BigDecimal(1.23) + 0
You can also write it simply as BigDecimal(0)
. If you're instantiating that a lot you might want to cache it as a named value (as for any other number), but you won't normally need to, and I think it helps simplify the API if you remove special cases that you have to remember.