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

---

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

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

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

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

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

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

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

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

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

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

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

  - [9.6.1. Замечания о воспроизводимости](https://python-all.ru/3.3/library/random.html#notes-on-reproducibility)
  - [9.6.2. Примеры и рецепты](https://python-all.ru/3.3/library/random.html#examples-and-recipes)
