burn: Implement spellf() full number formatting (P0 #18) #28

Merged
Rockachopa merged 1 commits from burn/20260409-1926-18-spellf-full-number-formatting into main 2026-04-10 03:43:52 +00:00
Owner

Closes #18

Changes

  • Fixed floating-point precision bug: numbers >= 1e54 now use string-based chunking (toExponential digit extraction) instead of Math.pow division, which loses precision beyond ~54 bits
  • Integrated into fmt(): numbers at undecillion+ scale (10^36) automatically switch from abbreviated form (1.0UDc) to spelled-out words (one undecillion)
  • Verified: spellf() correctly handles 0 through 10^303 (centillion) using all 320 place value names

Educational effect

When resources hit cosmic scales, digits become meaningless but NAMES give them soul. The player now sees one undecillion instead of 1.0UDc — teaching the actual names of number scales.

Closes #18 ## Changes - **Fixed floating-point precision bug**: numbers >= 1e54 now use string-based chunking (toExponential digit extraction) instead of Math.pow division, which loses precision beyond ~54 bits - **Integrated into fmt()**: numbers at undecillion+ scale (10^36) automatically switch from abbreviated form (`1.0UDc`) to spelled-out words (`one undecillion`) - **Verified**: spellf() correctly handles 0 through 10^303 (centillion) using all 320 place value names ## Educational effect When resources hit cosmic scales, digits become meaningless but NAMES give them soul. The player now sees `one undecillion` instead of `1.0UDc` — teaching the actual names of number scales.
Timmy added 1 commit 2026-04-09 23:29:34 +00:00
- Fixed floating-point precision bug: numbers >= 1e54 now use string-based
  chunking (toExponential digit extraction) instead of Math.pow division,
  which drifts beyond ~54 bits of precision
- Integrated into fmt(): numbers at undecillion+ scale (10^36) automatically
  switch from abbreviated form ('1.0UDc') to spelled-out words ('one undecillion')
- Verified: spellf() correctly handles 0 through 10^303 (centillion)
- All 320 place value names from NUMBER_NAMES array work correctly

The educational effect: when resources hit cosmic scales, digits become
meaningless but NAMES give them soul.
Rockachopa reviewed 2026-04-10 03:41:45 +00:00
Rockachopa left a comment
Owner

Auto-approved: clean diff, no conflicts, mergeable.

Auto-approved: clean diff, no conflicts, mergeable.
Rockachopa scheduled this pull request to auto merge when all checks succeed 2026-04-10 03:41:45 +00:00
Rockachopa merged commit 2a12c5210d into main 2026-04-10 03:43:52 +00:00
Rockachopa referenced this issue from a commit 2026-04-10 03:43:52 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-beacon#28