Skip to content

Sharpen README pitch and motivation#205

Merged
jessealama merged 17 commits into
mainfrom
sharpen-decimal-pitch
Jun 30, 2026
Merged

Sharpen README pitch and motivation#205
jessealama merged 17 commits into
mainfrom
sharpen-decimal-pitch

Conversation

@jessealama

Copy link
Copy Markdown
Collaborator

Rework the opening paragraphs in the README to motivate Decimal from two angles: (1) the practical case (real, end-user-visible rounding bugs from using binary floating-point Numbers for decimal calculations), and (2) the foundational one (a numeric type that matches the arithmetic we were taught, where 0.1 + 0.2 is 0.3).

Focus on exact arithmetic, clarify the relationship between the Decimal and Amount proposals, explain "normalization on the way out".

Merge the standalone RELATED.md into the README so related proposals live in one place.

@caiolima caiolima left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jessealama jessealama merged commit 1ed01b6 into main Jun 30, 2026
1 check passed
@jessealama jessealama deleted the sharpen-decimal-pitch branch June 30, 2026 12:45
Comment thread docs/decimal.md
<!-- prettier-ignore-end -->

`Decimal` values are canonicalized, meaning that different representations of the same mathematical value are normalized. For example, "1.20" and "1.2" both result in the same `Decimal` value.
`Decimal` never exposes trailing zeroes: different representations of the same mathematical value are indistinguishable. For example, "1.20" and "1.2" compare as equal and render identically with `toString`. (An implementation may store values unnormalized internally and normalize only on the way out, when rendering or comparing.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Decimal` never exposes trailing zeroes: different representations of the same mathematical value are indistinguishable. For example, "1.20" and "1.2" compare as equal and render identically with `toString`. (An implementation may store values unnormalized internally and normalize only on the way out, when rendering or comparing.)
`Decimal` never exposes trailing zeroes: different representations of the same mathematical value are indistinguishable. For example, "1.20" and "1.2" compare as equal and render identically with `toString`. An implementation may store values unnormalized internally and normalize only on the way out, when rendering or comparing.

Comment thread README.md
Decimal is based on IEEE 754-2019 Decimal128, which is a standard for base-10 decimal numbers using 128 bits. We will offer a subset of the official Decimal128. There will be, in particular:
As noted [above](#specification-and-standards), Decimal uses the IEEE 754-2019 Decimal128 data model. We will offer a subset of the official Decimal128. There will be, in particular:

- a single NaN value--distinct from the built-in `NaN` of JS. The difference between quiet and singaling NaNs will be collapsed into a single (quiet) Decimal NaN.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- a single NaN value--distinct from the built-in `NaN` of JS. The difference between quiet and singaling NaNs will be collapsed into a single (quiet) Decimal NaN.
- a single NaN value--distinct from the built-in `NaN` of JS. The difference between quiet and signaling NaNs will be collapsed into a single (quiet) Decimal NaN.

@gameroman

Copy link
Copy Markdown
Contributor

oops I'm late. sorry

@jessealama

Copy link
Copy Markdown
Collaborator Author

oops I'm late. sorry

These are nice changes, thank you! I'm happy to incorporate them. Anything that helps improve clarity is welcome.

jessealama added a commit that referenced this pull request Jun 30, 2026
Co-authored-by: gameroman <121314722+gameroman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants