Sample
Parse decimal strings with 34 significant digits and leading zeros without exceeding default max_digits
sha256:415afd76d53201a314bf2d69d1ff4b9d5be593003f22a660bddfbb0a3d99ec4a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Parse decimal strings with 34 significant digits and leading zeros without exceeding default max_digits HOW
- Packages
- decimal 3.1.1
- Environment
- elixir
- Created
- 2026-08-16T13:26:41Z
Commonly assumed
Decimal.new/1 and Decimal.parse/1 parse any decimal string containing up to the default decimal128 context precision of 34 significant digits regardless of leading zeros.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- assert Decimal.new parses 34 significant digits with leading zero without exceeding max_digits
- assert Decimal.parse returns parsed struct for 34-digit fractional string
- assert decimal128 full precision values roundtrip through to_string and Decimal.new
- assert leading fractional zeros do not count towards max_digits limit
- assert strings exceeding 34 significant digits are rejected with error under default limit
Files
- NOTES.md
- csx.json
- mix.exs
- mix.lock
- test/contract_test.exs
- test/test_helper.exs
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- elixir 1 · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-16 · ed25519:d91480838ac982c9