@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.13\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-07-25 15:00+0000\n "
14
+ "POT-Creation-Date : 2025-08-05 15:00+0000\n "
15
15
"PO-Revision-Date : 2025-07-18 19:21+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -36,36 +36,27 @@ msgstr ":mod:`fractions` 模块支持分数运算。"
36
36
37
37
#: ../../library/fractions.rst:17
38
38
msgid ""
39
- "A Fraction instance can be constructed from a pair of integers , from another "
40
- " rational number, or from a string."
41
- msgstr "分数实例可以由一对整数,一个分数,或者一个字符串构建而成。 "
39
+ "A Fraction instance can be constructed from a pair of rational numbers , from"
40
+ " a single number, or from a string."
41
+ msgstr ""
42
42
43
43
#: ../../library/fractions.rst:26
44
44
msgid ""
45
45
"The first version requires that *numerator* and *denominator* are instances "
46
46
"of :class:`numbers.Rational` and returns a new :class:`Fraction` instance "
47
- "with value ``numerator/denominator``. If *denominator* is ``0``, it raises a "
48
- " :exc:`ZeroDivisionError`. The second version requires that *other_fraction* "
49
- " is an instance of :class:`numbers.Rational` and returns a :class:`Fraction` "
50
- " instance with the same value. The next two versions accept either a "
51
- ":class:`float` or a :class:`decimal.Decimal` instance, and return a "
52
- ":class:`Fraction` instance with exactly the same value. Note that due to "
53
- "the usual issues with binary floating point (see :ref:`tut-fp-issues`), the "
54
- "argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so "
55
- "``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might "
56
- "expect. (But see the documentation for the :meth:`limit_denominator` method "
57
- "below.) The last version of the constructor expects a string or unicode "
47
+ "with a value equal to ``numerator/denominator``. If *denominator* is zero, "
48
+ "it raises a :exc:`ZeroDivisionError`. The second version requires that "
49
+ "*other_fraction* is an instance of :class:`numbers.Rational` and returns a "
50
+ ":class:`Fraction` instance with the same value. The next two versions "
51
+ "accept either a :class:`float` or a :class:`decimal.Decimal` instance, and "
52
+ "return a :class:`Fraction` instance with exactly the same value. Note that "
53
+ "due to the usual issues with binary floating point (see :ref:`tut-fp-"
54
+ "issues`), the argument to ``Fraction(1.1)`` is not exactly equal to 11/10, "
55
+ "and so ``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might"
56
+ " expect. (But see the documentation for the :meth:`limit_denominator` method"
57
+ " below.) The last version of the constructor expects a string or unicode "
58
58
"instance. The usual form for this instance is::"
59
59
msgstr ""
60
- "第一个版本要求 *numerator* 和 *denominator* 是 :class:`numbers.Rational` 的实例,并返回一个值为 "
61
- "``numerator/denominator`` 的新 :class:`Fraction` 实例。 如果 *denominator* 是 ``0`` "
62
- "则会引发 :exc:`ZeroDivisionError`。 第二个版本要求 *other_fraction* 是 "
63
- ":class:`numbers.Rational` 的实例,并返回具有相同值的 :class:`Fraction` 实例。 接下来的两个版本接受 "
64
- ":class:`float` 或 :class:`decimal.Decimal` 实例,并返回具有完全相同值的 :class:`Fraction` "
65
- "实例。 请注意由于二进制浮点运算通常存在的问题 (参见 :ref:`tut-fp-issues`),``Fraction(1.1)`` "
66
- "的参数并不完全等于 11/10,因此 ``Fraction(1.1)`` 也 *不会* 像人们所期望的那样返回 ``Fraction(11, "
67
- "10)``。 (请参阅下面 :meth:`limit_denominator` 方法的文档。) 最后一个版本的构造器接受一个字符串或 unicode "
68
- "实例。 该实例的通常形式为::"
69
60
70
61
#: ../../library/fractions.rst:41
71
62
msgid "[sign] numerator ['/' denominator]"
@@ -203,20 +194,21 @@ msgid "Numerator of the Fraction in lowest term."
203
194
msgstr "最简分数形式的分子。"
204
195
205
196
#: ../../library/fractions.rst:119
206
- msgid "Denominator of the Fraction in lowest term."
207
- msgstr "最简分数形式的分母。"
197
+ msgid ""
198
+ "Denominator of the Fraction in lowest terms. Guaranteed to be positive."
199
+ msgstr ""
208
200
209
- #: ../../library/fractions.rst:124
201
+ #: ../../library/fractions.rst:125
210
202
msgid ""
211
203
"Return a tuple of two integers, whose ratio is equal to the original "
212
204
"Fraction. The ratio is in lowest terms and has a positive denominator."
213
205
msgstr "返回由两个整数组成的元组,两数之比等于原 Fraction 的值且其分母为正数。"
214
206
215
- #: ../../library/fractions.rst:132
207
+ #: ../../library/fractions.rst:133
216
208
msgid "Return ``True`` if the Fraction is an integer."
217
209
msgstr "如果 Fraction 为整数则返回 ``True``。"
218
210
219
- #: ../../library/fractions.rst:138
211
+ #: ../../library/fractions.rst:139
220
212
msgid ""
221
213
"Alternative constructor which only accepts instances of :class:`float` or "
222
214
":class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not "
@@ -225,26 +217,26 @@ msgstr ""
225
217
"只接受 :class:`float` 或 :class:`numbers.Integral` 实例的替代性构造器。 请注意 "
226
218
"``Fraction.from_float(0.3)`` 与 ``Fraction(3, 10)`` 的值是不同的。"
227
219
228
- #: ../../library/fractions.rst:144
220
+ #: ../../library/fractions.rst:145
229
221
msgid ""
230
222
"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance"
231
223
" directly from a :class:`float`."
232
224
msgstr "从 Python 3.2 开始,在构造 :class:`Fraction` 实例时可以直接使用 :class:`float`。"
233
225
234
- #: ../../library/fractions.rst:150
226
+ #: ../../library/fractions.rst:151
235
227
msgid ""
236
228
"Alternative constructor which only accepts instances of "
237
229
":class:`decimal.Decimal` or :class:`numbers.Integral`."
238
230
msgstr "只接受 :class:`decimal.Decimal` 或 :class:`numbers.Integral` 实例的替代性构造器。"
239
231
240
- #: ../../library/fractions.rst:155
232
+ #: ../../library/fractions.rst:156
241
233
msgid ""
242
234
"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance"
243
235
" directly from a :class:`decimal.Decimal` instance."
244
236
msgstr ""
245
237
"从 Python 3.2 开始,在构造 :class:`Fraction` 实例时可以直接使用 :class:`decimal.Decimal` 实例。"
246
238
247
- #: ../../library/fractions.rst:162
239
+ #: ../../library/fractions.rst:163
248
240
msgid ""
249
241
"Finds and returns the closest :class:`Fraction` to ``self`` that has "
250
242
"denominator at most max_denominator. This method is useful for finding "
@@ -253,23 +245,23 @@ msgstr ""
253
245
"找到并返回一个 :class:`Fraction` 使得其值最接近 ``self`` 并且分母不大于 max_denominator。 "
254
246
"此方法适用于找出给定浮点数的有理数近似值:"
255
247
256
- #: ../../library/fractions.rst:170
248
+ #: ../../library/fractions.rst:171
257
249
msgid "or for recovering a rational number that's represented as a float:"
258
250
msgstr "或是用来恢复被表示为一个浮点数的有理数:"
259
251
260
- #: ../../library/fractions.rst:183
252
+ #: ../../library/fractions.rst:184
261
253
msgid ""
262
254
"Returns the greatest :class:`int` ``<= self``. This method can also be "
263
255
"accessed through the :func:`math.floor` function:"
264
256
msgstr "返回最大的 :class:`int` ``<= self``。 此方法也可通过 :func:`math.floor` 函数来使用:"
265
257
266
- #: ../../library/fractions.rst:193
258
+ #: ../../library/fractions.rst:194
267
259
msgid ""
268
260
"Returns the least :class:`int` ``>= self``. This method can also be "
269
261
"accessed through the :func:`math.ceil` function."
270
262
msgstr "返回最小的 :class:`int` ``>= self``。 此方法也可通过 :func:`math.ceil` 函数来使用。"
271
263
272
- #: ../../library/fractions.rst:200
264
+ #: ../../library/fractions.rst:201
273
265
msgid ""
274
266
"The first version returns the nearest :class:`int` to ``self``, rounding "
275
267
"half to even. The second version rounds ``self`` to the nearest multiple of "
@@ -281,7 +273,7 @@ msgstr ""
281
273
"舍入到最接近 ``Fraction(1, 10**ndigits)`` 的倍数(如果 ``ndigits`` "
282
274
"为负值则为逻辑运算),位值为二分之一时同样只对偶数舍入。 此方法也可通过 :func:`round` 函数来使用。"
283
275
284
- #: ../../library/fractions.rst:208
276
+ #: ../../library/fractions.rst:209
285
277
msgid ""
286
278
"Provides support for formatting of :class:`Fraction` instances via the "
287
279
":meth:`str.format` method, the :func:`format` built-in function, or "
@@ -290,7 +282,7 @@ msgstr ""
290
282
"通过 :meth:`str.format` 方法、:func:`format` 内置函数或 :ref:`格式化字符串字面值 <f-strings>` "
291
283
"提供对 :class:`Fraction` 实例格式化的支持。"
292
284
293
- #: ../../library/fractions.rst:212
285
+ #: ../../library/fractions.rst:213
294
286
msgid ""
295
287
"If the ``format_spec`` format specification string does not end with one of "
296
288
"the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` "
@@ -306,7 +298,7 @@ msgstr ""
306
298
"中描述的有关填充、对齐、正负号处理、最小宽度和分组的一般规则。 “替代形式”旗标 ``'#'`` "
307
299
"也是受支持的:如果提供,将强制输出字符串始终包括一个显式的分母,即使被格式化的值恰好为整数也是如此。 表示填充零值的旗标 ``'0'`` 是不被支持的。"
308
300
309
- #: ../../library/fractions.rst:222
301
+ #: ../../library/fractions.rst:223
310
302
msgid ""
311
303
"If the ``format_spec`` format specification string ends with one of the "
312
304
"presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or "
@@ -317,11 +309,11 @@ msgstr ""
317
309
"``'g'``, ``'G'`` 或 ``'%'`` 之一那么格式化操作将遵循在 :ref:`formatspec` 小节中针对 "
318
310
":class:`float` 类型所描述的规则。"
319
311
320
- #: ../../library/fractions.rst:227
312
+ #: ../../library/fractions.rst:228
321
313
msgid "Here are some examples::"
322
314
msgstr "这是一些例子::"
323
315
324
- #: ../../library/fractions.rst:229
316
+ #: ../../library/fractions.rst:230
325
317
msgid ""
326
318
">>> from fractions import Fraction\n"
327
319
">>> format(Fraction(103993, 33102), '_')\n"
@@ -361,10 +353,10 @@ msgstr ""
361
353
">>> \" {:.2%} price increase\" .format(Fraction(new_price, old_price) - 1)\n"
362
354
"'34.67% price increase'"
363
355
364
- #: ../../library/fractions.rst:251
356
+ #: ../../library/fractions.rst:252
365
357
msgid "Module :mod:`numbers`"
366
358
msgstr ":mod:`numbers` 模块"
367
359
368
- #: ../../library/fractions.rst:252
360
+ #: ../../library/fractions.rst:253
369
361
msgid "The abstract base classes making up the numeric tower."
370
362
msgstr "构成数字塔的所有抽象基类。"
0 commit comments