Skip to content

Commit

Permalink
grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
jessealama committed Jan 20, 2025
1 parent dac39a7 commit e41c786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unified-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ This three-class approach would provide explicit separation between:
2. Normalized mathematical values (`Decimal`)
3. Measurements with units (`Measure`)
It is unclear whether `Decimal128` should support arithmetic. We envision it largely as a contain for a number plus a precision. Although IEEE 754 does specify how the quanta of the arguments of mathematical operations determines the quantum of the result, it is difficult to understand these rules. On the one hand, one could provide these operations and simply follow IEEE 754, for the simple reason that IEEE 754 is a well-known standard. On the other hand, we believe that following these rules would be strange to JS programmers.
It is unclear whether `Decimal128` should support arithmetic. We envision it largely as a container for a number-and-unit, plus a precision. Although IEEE 754 does specify how the quanta of the arguments of mathematical operations determines the quantum of the result, it is difficult to understand these rules. On the one hand, one could provide these operations and simply follow IEEE 754, for the simple reason that IEEE 754 is a well-known standard. On the other hand, we believe that following these rules would be strange to JS programmers.
While this design offers more explicit control over precision and normalization, we opted for the two-class design because it has a simpler mental model (fewer types to learn and understand). Also, in the two-class approach, precision handling naturally belongs with measurement. The two-class approach has a reduced API surface area and fewer conversion paths, a clearer separation between mathematical values and measured quantities, and many use cases don't require the distinction between normalized and non-normalized decimal values outside of measurements.
Expand Down

0 comments on commit e41c786

Please sign in to comment.