Closed
Description
Division is a bit of a conundrum with arbitrary-sized decimal types. This was discussed in the 2017 TC39 presentation. There are two basic approaches I've seen in the ecosystem:
- Java-like: Require that the user provide the precision and/or rounding mode as a parameter when performing division
- Ruby-like: Just choose an arbitrary amount of extra decimal places to use for the division result
- The implicit third option is to avoid division, and instead have a div/mod operation, or a "partition" operation (to split a BigDecimal into an integer number of buckets as equally as possible, at the precision of the BigDecimal)
I'm not sure what to do here. I've even considered whether this is the straw that breaks the camel's back, requiring 128-bit IEEE 754 decimal. What are your thoughts?
Metadata
Metadata
Assignees
Labels
No labels