> **Источник:** https://python-all.ru/3.9/library/numeric.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# Числовые и математические модули

Модули, описанные в этой главе, предоставляют числовые и математические функции и типы данных. Модуль [`numbers`](https://python-all.ru/3.9/library/numbers.html#module-numbers) определяет абстрактную иерархию числовых типов. Модули [`math`](https://python-all.ru/3.9/library/math.html#module-math) и [`cmath`](https://python-all.ru/3.9/library/cmath.html#module-cmath) содержат различные математические функции для чисел с плавающей запятой и комплексных чисел. Модуль [`decimal`](https://python-all.ru/3.9/library/decimal.html#module-decimal) поддерживает точные представления десятичных чисел, используя арифметику произвольной точности.

В этой главе описаны следующие модули:

- [`numbers` – Числовые абстрактные базовые классы](https://python-all.ru/3.9/library/numbers.html)

  - [Числовая иерархия](https://python-all.ru/3.9/library/numbers.html#the-numeric-tower)
  - [Примечания для разработчиков типов](https://python-all.ru/3.9/library/numbers.html#notes-for-type-implementors)

    - [Добавление дополнительных числовых абстрактных базовых классов](https://python-all.ru/3.9/library/numbers.html#adding-more-numeric-abcs)
    - [Реализация арифметических операций](https://python-all.ru/3.9/library/numbers.html#implementing-the-arithmetic-operations)
- [`math` – Математические функции](https://python-all.ru/3.9/library/math.html)

  - [Теоретико-числовые функции и функции представления](https://python-all.ru/3.9/library/math.html#number-theoretic-and-representation-functions)
  - [Степенные и логарифмические функции](https://python-all.ru/3.9/library/math.html#power-and-logarithmic-functions)
  - [Тригонометрические функции](https://python-all.ru/3.9/library/math.html#trigonometric-functions)
  - [Преобразование угловых величин](https://python-all.ru/3.9/library/math.html#angular-conversion)
  - [Гиперболические функции](https://python-all.ru/3.9/library/math.html#hyperbolic-functions)
  - [Специальные функции](https://python-all.ru/3.9/library/math.html#special-functions)
  - [Константы](https://python-all.ru/3.9/library/math.html#constants)
- [`cmath` – Математические функции для комплексных чисел](https://python-all.ru/3.9/library/cmath.html)

  - [Преобразование в полярные координаты и обратно](https://python-all.ru/3.9/library/cmath.html#conversions-to-and-from-polar-coordinates)
  - [Степенные и логарифмические функции](https://python-all.ru/3.9/library/cmath.html#power-and-logarithmic-functions)
  - [Тригонометрические функции](https://python-all.ru/3.9/library/cmath.html#trigonometric-functions)
  - [Гиперболические функции](https://python-all.ru/3.9/library/cmath.html#hyperbolic-functions)
  - [Функции классификации](https://python-all.ru/3.9/library/cmath.html#classification-functions)
  - [Константы](https://python-all.ru/3.9/library/cmath.html#constants)
- [`decimal` – Decimal: арифметика с фиксированной и плавающей точкой](https://python-all.ru/3.9/library/decimal.html)

  - [Краткое руководство](https://python-all.ru/3.9/library/decimal.html#quick-start-tutorial)
  - [Объекты Decimal](https://python-all.ru/3.9/library/decimal.html#decimal-objects)

    - [Логические операнды](https://python-all.ru/3.9/library/decimal.html#logical-operands)
  - [Объекты контекста](https://python-all.ru/3.9/library/decimal.html#context-objects)
  - [Константы](https://python-all.ru/3.9/library/decimal.html#constants)
  - [Режимы округления](https://python-all.ru/3.9/library/decimal.html#rounding-modes)
  - [Сигналы](https://python-all.ru/3.9/library/decimal.html#signals)
  - [Примечания о числах с плавающей точкой](https://python-all.ru/3.9/library/decimal.html#floating-point-notes)

    - [Уменьшение ошибки округления за счёт повышенной точности](https://python-all.ru/3.9/library/decimal.html#mitigating-round-off-error-with-increased-precision)
    - [Особые значения](https://python-all.ru/3.9/library/decimal.html#special-values)
  - [Работа с потоками](https://python-all.ru/3.9/library/decimal.html#working-with-threads)
  - [Рецепты](https://python-all.ru/3.9/library/decimal.html#recipes)
  - [Часто задаваемые вопросы по Decimal](https://python-all.ru/3.9/library/decimal.html#decimal-faq)
- [`fractions` – Рациональные числа](https://python-all.ru/3.9/library/fractions.html)
- [`random` – Генерация псевдослучайных чисел](https://python-all.ru/3.9/library/random.html)

  - [Учётные функции](https://python-all.ru/3.9/library/random.html#bookkeeping-functions)
  - [Функции для байтов](https://python-all.ru/3.9/library/random.html#functions-for-bytes)
  - [Функции для целых чисел](https://python-all.ru/3.9/library/random.html#functions-for-integers)
  - [Функции для последовательностей](https://python-all.ru/3.9/library/random.html#functions-for-sequences)
  - [Распределения с действительными значениями](https://python-all.ru/3.9/library/random.html#real-valued-distributions)
  - [Альтернативный генератор](https://python-all.ru/3.9/library/random.html#alternative-generator)
  - [Замечания о воспроизводимости](https://python-all.ru/3.9/library/random.html#notes-on-reproducibility)
  - [Примеры](https://python-all.ru/3.9/library/random.html#examples)
  - [Рецепты](https://python-all.ru/3.9/library/random.html#recipes)
- [`statistics` – Функции математической статистики](https://python-all.ru/3.9/library/statistics.html)

  - [Средние значения и меры центральной тенденции](https://python-all.ru/3.9/library/statistics.html#averages-and-measures-of-central-location)
  - [Меры разброса](https://python-all.ru/3.9/library/statistics.html#measures-of-spread)
  - [Описание функций](https://python-all.ru/3.9/library/statistics.html#function-details)
  - [Исключения](https://python-all.ru/3.9/library/statistics.html#exceptions)
  - [`NormalDist` объекты](https://python-all.ru/3.9/library/statistics.html#normaldist-objects)

    - [Примеры и рецепты `NormalDist`](https://python-all.ru/3.9/library/statistics.html#normaldist-examples-and-recipes)
