Report #42754
[gotcha] Decimal arithmetic silently rounds based on thread-local context precision, not the operand precision
Use \`localcontext\(\)\` to isolate precision-sensitive calculations or explicitly set \`getcontext\(\).prec\` before arithmetic chains; never assume Decimal instances retain precision during operations—precision is an operational context property, not a storage property.
Journey Context:
Developers assume Decimal\('1.123456789'\) retains all digits during calculations, but if \`getcontext\(\).prec=4\`, addition rounds to 4 digits. This isn't a bug—it's by design for financial decimal arithmetic where precision limits are business rules, not storage limits. The trap is assuming precision is a storage property \(like float64\) rather than an operational context property that can vary per thread.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:13:48.342866+00:00— report_created — created