
decimal — Decimal fixed-point and floating-point arithmetic
3 days ago · The decimal module was designed to support “without prejudice, both exact unrounded decimal arithmetic (sometimes called fixed-point arithmetic) and rounded floating-point arithmetic.” – excerpt from the decimal arithmetic specification.
Numeric and Mathematical Modules — Python 3.13.3 …
3 days ago · The numbers module defines an abstract hierarchy of numeric types. The math and cmath modules contain various mathematical functions for floating-point and complex numbers. The decimal module supports exact representations of decimal …
11. Brief Tour of the Standard Library — Part II - Python
1 day ago · The decimal module offers a Decimal datatype for decimal floating-point arithmetic. Compared to the built-in float implementation of binary floating point, the class is especially helpful for financial applications and other uses which require exact decimal representation,
fractions — Rational numbers — Python 3.13.3 documentation
3 days ago · From Python 3.2 onwards, you can also construct a Fraction instance directly from a decimal.Decimal instance. limit_denominator ( max_denominator = 1000000 ) ¶ Finds and returns the closest Fraction to self that has denominator at most max_denominator.
json — JSON encoder and decoder — Python 3.13.3 documentation
1 day ago · This can be used to parse JSON floats into custom datatypes, for example decimal.Decimal. parse_int ( callable | None) – If set, a function that is called with the string of every JSON int to be decoded.
15. Floating-Point Arithmetic: Issues and Limitations - Python
Pour les cas requérant une représentation décimale exacte, le module decimal peut être utile : il implémente l'arithmétique décimale et peut donc être un choix adapté pour des applications nécessitant une grande précision.
math — Mathematical functions — Python 3.13.3 documentation
1 day ago · This module provides access to the mathematical functions defined by the C standard. These functions cannot be used with complex numbers; use the functions of the same name from the cmath module if...
What’s New in Python 2.4 — Python 3.13.3 documentation
Mar 30, 2005 · A new module, decimal, was added to Python’s standard library. It contains two classes, Decimal and Context. Decimal instances represent numbers, and Context instances are used to wrap up various settings such as the precision and default rounding mode.
locale — Internationalization services — Python 3.13.3 …
3 days ago · The locale module is implemented on top of the _locale module, which in turn uses an ANSI C locale implementation if available. The locale module defines the following exception and functions: exception locale.
time — Time access and conversions — Python 3.13.3 …
Time zone offset indicating a positive or negative time difference from UTC/GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M represents decimal minute digits [-23:59, +23:59].