@@ -757,45 +757,58 @@ msgstr ""
757757
758758#: ../../tutorial/stdlib2.rst:356
759759msgid "Decimal Floating-Point Arithmetic"
760- msgstr ""
760+ msgstr "Десятичная арифметика с плавающей точкой "
761761
762762#: ../../tutorial/stdlib2.rst:358
763763msgid ""
764764"The :mod:`decimal` module offers a :class:`~decimal.Decimal` datatype for "
765765"decimal floating-point arithmetic. Compared to the built-in :class:`float` "
766766"implementation of binary floating point, the class is especially helpful for"
767767msgstr ""
768+ "Модуль :mod:`decimal` предлагает тип данных :class:`~decimal.Decimal` для "
769+ "десятичной арифметики с плавающей точкой. По сравнению со встроенным типом "
770+ ":class:`float`, реализующим двоичные числа с плавающей точкой, этот класс "
771+ "особенно полезен для"
768772
769773#: ../../tutorial/stdlib2.rst:362
770774msgid ""
771775"financial applications and other uses which require exact decimal "
772776"representation,"
773777msgstr ""
778+ "финансовых приложений и других случаев, требующих точного десятичного "
779+ "представления,"
774780
775781#: ../../tutorial/stdlib2.rst:364
776782msgid "control over precision,"
777- msgstr ""
783+ msgstr "контроля точности, "
778784
779785#: ../../tutorial/stdlib2.rst:365
780786msgid "control over rounding to meet legal or regulatory requirements,"
781787msgstr ""
788+ "контроля округления для соответствия законодательным или нормативным "
789+ "требованиям,"
782790
783791#: ../../tutorial/stdlib2.rst:366
784792msgid "tracking of significant decimal places, or"
785- msgstr ""
793+ msgstr "отслеживания значащих десятичных разрядов или "
786794
787795#: ../../tutorial/stdlib2.rst:367
788796msgid ""
789797"applications where the user expects the results to match calculations done "
790798"by hand."
791799msgstr ""
800+ "приложений, в которых пользователь ожидает, что результаты совпадут с "
801+ "расчётами, выполненными вручную."
792802
793803#: ../../tutorial/stdlib2.rst:370
794804msgid ""
795805"For example, calculating a 5% tax on a 70 cent phone charge gives different "
796806"results in decimal floating point and binary floating point. The difference "
797807"becomes significant if the results are rounded to the nearest cent::"
798808msgstr ""
809+ "Например, расчёт налога в размере 5% от счёта за телефон на 70 центов даёт "
810+ "разные результаты в десятичном и двоичном представлении чисел с плавающей "
811+ "точкой. Разница становится значимой, если результаты округлить до цента:"
799812
800813#: ../../tutorial/stdlib2.rst:374
801814msgid ""
@@ -805,6 +818,11 @@ msgid ""
805818">>> round(.70 * 1.05, 2)\n"
806819"0.73"
807820msgstr ""
821+ ">>> from decimal import *\n"
822+ ">>> round(Decimal('0.70') * Decimal('1.05'), 2)\n"
823+ "Decimal('0.74')\n"
824+ ">>> round(.70 * 1.05, 2)\n"
825+ "0.73"
808826
809827#: ../../tutorial/stdlib2.rst:380
810828msgid ""
@@ -814,13 +832,22 @@ msgid ""
814832"issues that can arise when binary floating point cannot exactly represent "
815833"decimal quantities."
816834msgstr ""
835+ "Результат :class:`~decimal.Decimal` сохраняет конечный ноль, автоматически "
836+ "выводя точность до четырёх значащих цифр в дробной части на основе "
837+ "множителей с двумя знаками в дробной части. Класс Decimal воспроизводит "
838+ "математику так, как она выполняется вручную, и позволяет избежать проблем, "
839+ "которые могут возникнуть, когда двоичные числа с плавающей точкой не могут "
840+ "точно представить десятичные величины."
817841
818842#: ../../tutorial/stdlib2.rst:386
819843msgid ""
820844"Exact representation enables the :class:`~decimal.Decimal` class to perform "
821845"modulo calculations and equality tests that are unsuitable for binary "
822846"floating point::"
823847msgstr ""
848+ "Точное представление позволяет классу :class:`~decimal.Decimal` выполнять "
849+ "вычисления по модулю и проверки равенства, которые непригодны для двоичных "
850+ "чисел с плавающей точкой::"
824851
825852#: ../../tutorial/stdlib2.rst:390
826853msgid ""
@@ -834,16 +861,30 @@ msgid ""
834861">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n"
835862"False"
836863msgstr ""
864+ ">>> Decimal('1.00') % Decimal('.10')\n"
865+ "Decimal('0.00')\n"
866+ ">>> 1.00 % 0.10\n"
867+ "0.09999999999999995\n"
868+ "\n"
869+ ">>> sum([Decimal('0.1')]*10) == Decimal('1.0')\n"
870+ "True\n"
871+ ">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n"
872+ "False"
837873
838874#: ../../tutorial/stdlib2.rst:400
839875msgid ""
840876"The :mod:`decimal` module provides arithmetic with as much precision as "
841877"needed::"
842878msgstr ""
879+ "Модуль :mod:`decimal` обеспечивает арифметические операции с необходимой "
880+ "точностью::"
843881
844882#: ../../tutorial/stdlib2.rst:402
845883msgid ""
846884">>> getcontext().prec = 36\n"
847885">>> Decimal(1) / Decimal(7)\n"
848886"Decimal('0.142857142857142857142857142857142857')"
849887msgstr ""
888+ ">>> getcontext().prec = 36\n"
889+ ">>> Decimal(1) / Decimal(7)\n"
890+ "Decimal('0.142857142857142857142857142857142857')"
0 commit comments