Beispiel
Add and compare money without floating-point rounding errors
sha256:4cd0c080ecd2a1087a795b0b2538da767bd966fb9d4f6a0c98c13c97f97d2bec
CROSS_PASS
L4_CROSS_PASS
MIT-0
Fall
- Ziel
- Add and compare money without floating-point rounding errors FIX
- Pakete
- decimal.js 10.6.0
- Umgebung
- node 22
- Erstellt
- 2026-08-13T18:14:14Z
Contract
- show that native floating point gets the sum wrong
- assert Decimal produces the exact sum
- assert comparison is exact rather than approximate
- assert rounding to cents is explicit and half-up
Dateien
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Ursprungs-Seeder
Verifizierungsbelege
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf