About 200 results
Open links in new tab
  1. decimal — Decimal fixed-point and floating-point arithmetic

    1 day ago · Unlike hardware based binary floating point, the decimal module has a user alterable precision (defaulting to 28 places) which can be as large as needed for a given problem:

  2. 15. Floating-Point Arithmetic: Issues and Limitations - Python

    1 day ago · For use cases which require exact decimal representation, try using the decimal module which implements decimal arithmetic suitable for accounting applications and high-precision applications.

  3. Numeric and Mathematical Modules — Python 3.13.3 …

    1 day ago · The decimal module supports exact representations of decimal numbers, using arbitrary precision arithmetic. The following modules are documented in this chapter:

  4. 14. Arithmétique en nombres à virgule flottante - Python

    Jul 2, 2018 · Si vous êtes dans une situation où les arrondis de nombres décimaux à mi-chemin ont de l’importance, vous devriez utiliser le module decimal. Soit dit en passant, le module decimal propose aussi un moyen pratique de « voir » la …

  5. string — Common string operations — Python 3.13.3 …

    1 day ago · For a given precision p, formats the number as a decimal number with exactly p digits following the decimal point. With no precision given, uses a precision of 6 digits after the decimal point for float , and uses a precision large enough to show all coefficient digits for Decimal .

  6. Built-in Types — Python 3.13.3 documentation

    1 day ago · The precision determines the number of significant digits before and after the decimal point and defaults to 6. If precision is N, the output is truncated to N characters. See PEP 237. Since Python strings have an explicit length, %s conversions do not assume that '\0' …

  7. fractions — Rational numbers — Python 3.13.3 documentation

    1 day 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.

  8. math — Mathematical functions — Python 3.13.3 documentation

    1 day ago · For small floats x, the subtraction in exp(x)-1 can result in a significant loss of precision; the expm1() function provides a way to compute this quantity to full precision: >>>

  9. 5. The import system — Python 3.13.3 documentation

    1 day ago · Python code in one module gains access to the code in another module by the process of importing it. The import statement is the most common way of invoking the import machinery, but it is not the only way. Functions such as importlib.import_module() and built-in __import__() can also be used to invoke the import machinery.