tc39 / tc39/proposal-amount

Rationals

Open
#23 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
58
Forks
12
Avg merge
2h 35m
Merged PRs (30d)
2

Description

Rational numbers are compatible with an opaque Amount.

The data model could be "decimal over decimal integer", where a decimal integer is the set of all Decimal128 that are integer values.

Example data models to what they represent:

  1. (2.50 / 1) inch ==> 2.50 inches
  2. (5 / 2) inch ==> 5/2 inches
  3. (5 / 2) integral-inch ==> 2 1/2 inches

This can be added on to an opaque Amount.

Alternatively, this could be a core part of the proposal, since some delegates see rationals as well-motivated, and this is a clean way to add them: arithmetic is very likely out of scope of Amount, so we remove a whole class of issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the opaque Amount data model and the decimal-over-decimal-integer examples in this issue. Compare the rational-number alternative with the current proposal, then document a settled decision about whether rationals belong in Amount and what representation is in scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.