On this page
article
decimal — Decimal Arithmetic
Exact decimal math for finance.
Overview
Exact decimal math for finance.
Quick Example
Decimal('0.1') + Decimal('0.2')
When to Use
Use this module when you need built-in support without adding third-party dependencies.
Common Tasks
- Read the official docs: docs.python.org/3/library/decimal.html
- Combine with related modules in the Cookbook
- Prefer stdlib before reaching for PyPI packages