33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
6+ # Translators:
7+ # Meng Du <[email protected] >, 20198+ #
69#, fuzzy
710msgid ""
811msgstr ""
912"Project-Id-Version : Python 3.7\n "
1013"Report-Msgid-Bugs-To : \n "
1114"POT-Creation-Date : 2019-02-03 10:33+0900\n "
1215"PO-Revision-Date : 2017-02-16 23:06+0000\n "
16+ "
Last-Translator :
Meng Du <[email protected] >, 2019\n "
1317"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1418"MIME-Version : 1.0\n "
1519"Content-Type : text/plain; charset=UTF-8\n "
@@ -19,18 +23,19 @@ msgstr ""
1923
2024#: ../../library/decimal.rst:2
2125msgid ":mod:`decimal` --- Decimal fixed point and floating point arithmetic"
22- msgstr ""
26+ msgstr ":mod:`decimal` --- 十进制定点和浮点运算 "
2327
2428#: ../../library/decimal.rst:15
2529msgid "**Source code:** :source:`Lib/decimal.py`"
26- msgstr ""
30+ msgstr "**源码:** :source:`Lib/decimal.py` "
2731
2832#: ../../library/decimal.rst:33
2933msgid ""
3034"The :mod:`decimal` module provides support for fast correctly-rounded "
3135"decimal floating point arithmetic. It offers several advantages over the "
3236":class:`float` datatype:"
3337msgstr ""
38+ ":mod:`decimal` 模块为快速正确舍入的十进制浮点运算提供支持。 它提供了 :class:`float` 数据类型以外的几个优点:"
3439
3540#: ../../library/decimal.rst:37
3641msgid ""
@@ -40,6 +45,8 @@ msgid ""
4045"people learn at school.\" -- excerpt from the decimal arithmetic "
4146"specification."
4247msgstr ""
48+ "Decimal “基于一个浮点模型,它是为人们设计的,并且必然具有最重要的指导原则 —— 计算机必须提供与人们在学校学习的算法相同的算法。” —— "
49+ "摘自十进制算术规范。"
4350
4451#: ../../library/decimal.rst:42
4552msgid ""
@@ -49,6 +56,8 @@ msgid ""
4956"display as :const:`3.3000000000000003` as it does with binary floating "
5057"point."
5158msgstr ""
59+ "十进制数字可以准确表示。 相比之下,数字如 :const:`1.1` 和 :const:`2.2` 在二进制浮点中没有精确的表示。 "
60+ "最终用户通常不希望``1.1 + 2.2``显示为 :const:`3.3000000000000003` ,就像二进制浮点一样。"
5261
5362#: ../../library/decimal.rst:47
5463msgid ""
@@ -59,6 +68,9 @@ msgid ""
5968"accumulate. For this reason, decimal is preferred in accounting applications"
6069" which have strict equality invariants."
6170msgstr ""
71+ "精确性延续到算术中。 在十进制浮点数中,``0.1 + 0.1 + 0.1 - 0.3`` 恰好等于零。 在二进制浮点数中,结果为 "
72+ ":const:`5.5511151231257827e-017` 。 虽然接近于零,但差异妨碍了可靠的相等性检验,并且差异可能会累积。 "
73+ "因此,在具有严格相等不变量的会计应用程序中, decimal 是首选。"
6274
6375#: ../../library/decimal.rst:54
6476msgid ""
@@ -69,13 +81,16 @@ msgid ""
6981"multiplicands. For instance, ``1.3 * 1.2`` gives :const:`1.56` while ``1.30"
7082" * 1.20`` gives :const:`1.5600`."
7183msgstr ""
84+ "十进制模块包含一个重要位置的概念,因此 ``1.30 + 1.20`` 是 :const:`2.50` 。 保留尾随零以表示重要性。 "
85+ "这是货币申请的惯常陈述。 对于乘法,“教科书”方法使用被乘数中的所有数字。 例如, ``1.3 * 1.2`` 给出 :const:`1.56` 而 "
86+ "``1.30 * 1.20`` 给出 :const:`1.5600` 。"
7287
7388#: ../../library/decimal.rst:61
7489msgid ""
7590"Unlike hardware based binary floating point, the decimal module has a user "
7691"alterable precision (defaulting to 28 places) which can be as large as "
7792"needed for a given problem:"
78- msgstr ""
93+ msgstr "与基于硬件的二进制浮点不同,十进制模块具有用户可更改的精度(默认为28个位置),可以与给定问题所需的一样大: "
7994
8095#: ../../library/decimal.rst:73
8196msgid ""
@@ -86,20 +101,22 @@ msgid ""
86101"signal handling. This includes an option to enforce exact arithmetic by "
87102"using exceptions to block any inexact operations."
88103msgstr ""
104+ "二进制和十进制浮点都是根据已发布的标准实现的。 虽然内置浮点类型只公开其功能的一小部分,但十进制模块公开了标准的所有必需部分。 "
105+ "在需要时,程序员可以完全控制舍入和信号处理。 这包括通过使用异常来阻止任何不精确操作来强制执行精确算术的选项。"
89106
90107#: ../../library/decimal.rst:80
91108msgid ""
92109"The decimal module was designed to support \" without prejudice, both exact "
93110"unrounded decimal arithmetic (sometimes called fixed-point arithmetic) and "
94111"rounded floating-point arithmetic.\" -- excerpt from the decimal arithmetic"
95112" specification."
96- msgstr ""
113+ msgstr "十进制模块旨在支持“无偏见,精确的非连续十进制算术(有时称为定点算术)和舍入浮点算术”。 —— 摘自十进制算术规范。 "
97114
98115#: ../../library/decimal.rst:85
99116msgid ""
100117"The module design is centered around three concepts: the decimal number, "
101118"the context for arithmetic, and signals."
102- msgstr ""
119+ msgstr "模块设计以三个概念为中心:十进制数,算术上下文和信号。 "
103120
104121#: ../../library/decimal.rst:88
105122msgid ""
@@ -109,6 +126,9 @@ msgid ""
109126":const:`Infinity`, :const:`-Infinity`, and :const:`NaN`. The standard also "
110127"differentiates :const:`-0` from :const:`+0`."
111128msgstr ""
129+ "十进制数是不可变的。 它有一个符号,系数数字和一个指数。 为了保持重要性,系数数字不会截断尾随零。十进制数也包括特殊值,例如 "
130+ ":const:`Infinity` ,:const:`-Infinity` ,和 :const:`NaN` 。 该标准还区分 :const:`-0` 和"
131+ " :const:`+0` 。"
112132
113133#: ../../library/decimal.rst:94
114134msgid ""
@@ -119,6 +139,10 @@ msgid ""
119139":const:`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN`, "
120140":const:`ROUND_HALF_UP`, :const:`ROUND_UP`, and :const:`ROUND_05UP`."
121141msgstr ""
142+ "算术的上下文是指定精度、舍入规则、指数限制、指示操作结果的标志以及确定符号是否被视为异常的陷阱启用器的环境。 舍入选项包括 "
143+ ":const:`ROUND_CEILING` 、 :const:`ROUND_DOWN` 、 :const:`ROUND_FLOOR` 、 "
144+ ":const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN` 、 :const:`ROUND_HALF_UP` "
145+ "、 :const:`ROUND_UP` 以及 :const:`ROUND_05UP`."
122146
123147#: ../../library/decimal.rst:101
124148msgid ""
@@ -130,6 +154,11 @@ msgid ""
130154":const:`Subnormal`, :const:`Overflow`, :const:`Underflow` and "
131155":const:`FloatOperation`."
132156msgstr ""
157+ "信号是在计算过程中出现的异常条件组。 根据应用程序的需要,信号可能会被忽略,被视为信息,或被视为异常。 "
158+ "十进制模块中的信号有::const:`Clamped` 、 :const:`InvalidOperation` 、 "
159+ ":const:`DivisionByZero` 、 :const:`Inexact` 、 :const:`Rounded` 、 "
160+ ":const:`Subnormal` 、 :const:`Overflow` 、 :const:`Underflow` 以及 "
161+ ":const:`FloatOperation` 。"
133162
134163#: ../../library/decimal.rst:108
135164msgid ""
@@ -138,23 +167,27 @@ msgid ""
138167"one, an exception is raised. Flags are sticky, so the user needs to reset "
139168"them before monitoring a calculation."
140169msgstr ""
170+ "对于每个信号,都有一个标志和一个陷阱启动器。 遇到信号时,其标志设置为 1 ,然后,如果陷阱启用器设置为 1 ,则引发异常。 "
171+ "标志是粘性的,因此用户需要在监控计算之前重置它们。"
141172
142173#: ../../library/decimal.rst:116
143174msgid ""
144175"IBM's General Decimal Arithmetic Specification, `The General Decimal "
145176"Arithmetic Specification <http://speleotrove.com/decimal/decarith.html>`_."
146177msgstr ""
178+ "IBM的通用十进制算术规范, `The General Decimal Arithmetic Specification "
179+ "<http://speleotrove.com/decimal/decarith.html>`_."
147180
148181#: ../../library/decimal.rst:125
149182msgid "Quick-start Tutorial"
150- msgstr ""
183+ msgstr "快速入门教程 "
151184
152185#: ../../library/decimal.rst:127
153186msgid ""
154187"The usual start to using decimals is importing the module, viewing the "
155188"current context with :func:`getcontext` and, if necessary, setting new "
156189"values for precision, rounding, or enabled traps::"
157- msgstr ""
190+ msgstr "通常使用小数的开始是导入模块,使用 :func:`getcontext` 查看当前上下文,并在必要时为精度、舍入或启用的陷阱设置新值:: "
158191
159192#: ../../library/decimal.rst:139
160193msgid ""
@@ -164,57 +197,60 @@ msgid ""
164197"values such as :const:`NaN` which stands for \" Not a number\" , positive and "
165198"negative :const:`Infinity`, and :const:`-0`::"
166199msgstr ""
200+ "可以从整数、字符串、浮点数或元组构造十进制实例。 从整数或浮点构造将执行该整数或浮点值的精确转换。 十进制数包括特殊值,例如 :const:`NaN` "
201+ "代表“非数字”,正的和负的 :const:`Infinity`,和 :const:`-0` ::"
167202
168203#: ../../library/decimal.rst:163
169204msgid ""
170205"If the :exc:`FloatOperation` signal is trapped, accidental mixing of "
171206"decimals and floats in constructors or ordering comparisons raises an "
172207"exception::"
173- msgstr ""
208+ msgstr "如果 :exc:`FloatOperation` 信号被捕获,构造函数中的小数和浮点数的意外混合或排序比较会引发异常 :: "
174209
175210#: ../../library/decimal.rst:182
176211msgid ""
177212"The significance of a new Decimal is determined solely by the number of "
178213"digits input. Context precision and rounding only come into play during "
179214"arithmetic operations."
180- msgstr ""
215+ msgstr "新 Decimal 的重要性仅由输入的位数决定。 上下文精度和舍入仅在算术运算期间发挥作用。 "
181216
182217#: ../../library/decimal.rst:199
183218msgid ""
184219"If the internal limits of the C version are exceeded, constructing a decimal"
185220" raises :class:`InvalidOperation`::"
186- msgstr ""
221+ msgstr "如果超出了C版本的内部限制,则构造一个十进制将引发 :class:`InvalidOperation` :: "
187222
188223#: ../../library/decimal.rst:209
189224msgid ""
190225"Decimals interact well with much of the rest of Python. Here is a small "
191226"decimal floating point flying circus:"
192- msgstr ""
227+ msgstr "小数与 Python 的其余部分很好地交互。 这是一个小的十进制浮点飞行杂技团: "
193228
194229#: ../../library/decimal.rst:241
195230msgid "And some mathematical functions are also available to Decimal:"
196- msgstr ""
231+ msgstr "Decimal 也可以使用一些数学函数: "
197232
198233#: ../../library/decimal.rst:253
199234msgid ""
200235"The :meth:`quantize` method rounds a number to a fixed exponent. This "
201236"method is useful for monetary applications that often round results to a "
202237"fixed number of places:"
203- msgstr ""
238+ msgstr ":meth:`quantize` 方法将数字四舍五入为固定指数。 此方法对于将结果舍入到固定的位置的货币应用程序非常有用: "
204239
205240#: ../../library/decimal.rst:262
206241msgid ""
207242"As shown above, the :func:`getcontext` function accesses the current context"
208243" and allows the settings to be changed. This approach meets the needs of "
209244"most applications."
210- msgstr ""
245+ msgstr "如上所示,:func:`getcontext` 函数访问当前上下文并允许更改设置。 这种方法满足大多数应用程序的需求。 "
211246
212247#: ../../library/decimal.rst:266
213248msgid ""
214249"For more advanced work, it may be useful to create alternate contexts using "
215250"the Context() constructor. To make an alternate active, use the "
216251":func:`setcontext` function."
217252msgstr ""
253+ "对于更高级的工作,使用 Context() 构造函数创建备用上下文可能很有用。 要使备用活动,请使用 :func:`setcontext` 函数。"
218254
219255#: ../../library/decimal.rst:270
220256msgid ""
0 commit comments