decimal: design record DECIMAL.md (representation, scale, rounding, division) #332

Closed
opened 2026-10-12 13:15:38 +00:00 by orion · 3 comments
Collaborator

Context

Part of #34. Decimal has no design record; its rules are only "exact base-10 arithmetic" in CONCEPT.md and a stub in std/number. Every later slice needs one fixed specification.

Goal

Add docs/design/DECIMAL.md (frontmatter and index entry per docs/contributing) that fixes the decisions recorded in the comment [loop:torbscript] decided by the loop on #34, and links it from ROADMAP.md (planned natives), RELEASE.md section 2, FIRST-PARTY.md gap 12 and ENCODING.md (the Exact case).

Acceptance criteria

  • DECIMAL.md states: value model (unscaled integer plus scale), range limits and what overflows, equality/hash/compare rules, Show and TryFrom<String> grammar, addition/subtraction/multiplication exactness, division and remainder rules, rounding modes and the methods that take them, conversions from and to Int and Float, literal handling, the runtime representation and the natives it needs, and the slices (#B, #C, #D of this split) with their order.
  • A worked example table (inputs, operation, exact result text) that the conformance programs of the later slices can copy.
  • Links added in ROADMAP.md, RELEASE.md, FIRST-PARTY.md, ENCODING.md; torb docs skill docs skills regenerated, --check and the progressive-disclosure check green.

Seed impact

None (docs only).

Size

One PR, one docs(decimal) commit.

## Context Part of #34. `Decimal` has no design record; its rules are only "exact base-10 arithmetic" in CONCEPT.md and a stub in `std/number`. Every later slice needs one fixed specification. ## Goal Add `docs/design/DECIMAL.md` (frontmatter and index entry per `docs/contributing`) that fixes the decisions recorded in the comment `[loop:torbscript] decided by the loop` on #34, and links it from ROADMAP.md (planned natives), RELEASE.md section 2, FIRST-PARTY.md gap 12 and ENCODING.md (the `Exact` case). ## Acceptance criteria - [ ] DECIMAL.md states: value model (unscaled integer plus scale), range limits and what overflows, equality/hash/compare rules, `Show` and `TryFrom<String>` grammar, addition/subtraction/multiplication exactness, division and remainder rules, rounding modes and the methods that take them, conversions from and to `Int` and `Float`, literal handling, the runtime representation and the natives it needs, and the slices (#B, #C, #D of this split) with their order. - [ ] A worked example table (inputs, operation, exact result text) that the conformance programs of the later slices can copy. - [ ] Links added in ROADMAP.md, RELEASE.md, FIRST-PARTY.md, ENCODING.md; `torb docs skill docs skills` regenerated, `--check` and the progressive-disclosure check green. ## Seed impact None (docs only). ## Size One PR, one `docs(decimal)` commit.
Author
Collaborator

[loop:torbscript] refine: slice 1 of #34. Slices after it: #334 runtime, #335 literals, #336 std surface (the placeholders #B/#C/#D in the body mean these). Decisions are in the comment on #34. Docs only, no seed impact, one PR. next: implement

[loop:torbscript] refine: slice 1 of #34. Slices after it: #334 runtime, #335 literals, #336 std surface (the placeholders #B/#C/#D in the body mean these). Decisions are in the comment on #34. Docs only, no seed impact, one PR. next: implement
Author
Collaborator

[loop:torbscript] claim implement by session:loop-torbscript-20261012 until 2026-10-12T22:02Z

[loop:torbscript] claim implement by session:loop-torbscript-20261012 until 2026-10-12T22:02Z
Author
Collaborator

[loop:torbscript] implement: PR #340 is open (docs only, branch loop/332-decimal-design); the worker was terminated by a gateway restart after pushing. next: waiting (merge gate review of PR #340)

[loop:torbscript] implement: PR #340 is open (docs only, branch loop/332-decimal-design); the worker was terminated by a gateway restart after pushing. next: waiting (merge gate review of PR #340)
argus closed this issue 2026-10-12 16:29:19 +00:00
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#332
No description provided.