-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathdecimal.po
2232 lines (1910 loc) · 109 KB
/
decimal.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alpha Du <alphanow@gmail.com>, 2019
# Naisen Xu <723648649@qq.com>, 2019
# ppcfish <ppcfish@gmail.com>, 2019
# Freesand Leo <yuqinju@163.com>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-01 16:02+0000\n"
"PO-Revision-Date: 2019-09-01 03:10+0000\n"
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/decimal.rst:2
msgid ":mod:`decimal` --- Decimal fixed point and floating point arithmetic"
msgstr ":mod:`decimal` --- 十进制定点和浮点运算"
#: ../../library/decimal.rst:15
msgid "**Source code:** :source:`Lib/decimal.py`"
msgstr "**源码:** :source:`Lib/decimal.py`"
#: ../../library/decimal.rst:33
msgid ""
"The :mod:`decimal` module provides support for fast correctly-rounded "
"decimal floating point arithmetic. It offers several advantages over the "
":class:`float` datatype:"
msgstr ""
":mod:`decimal` 模块为快速正确舍入的十进制浮点运算提供支持。 它提供了 :class:`float` 数据类型以外的几个优点:"
#: ../../library/decimal.rst:37
msgid ""
"Decimal \"is based on a floating-point model which was designed with people "
"in mind, and necessarily has a paramount guiding principle -- computers must"
" provide an arithmetic that works in the same way as the arithmetic that "
"people learn at school.\" -- excerpt from the decimal arithmetic "
"specification."
msgstr ""
"Decimal 类型的“设计是基于考虑人类习惯的浮点数模型,并且因此具有以下最高指导原则 —— 计算机必须提供与人们在学校所学习的算术相一致的算术。” "
"—— 摘自 decimal 算术规范描述。"
#: ../../library/decimal.rst:42
msgid ""
"Decimal numbers can be represented exactly. In contrast, numbers like "
":const:`1.1` and :const:`2.2` do not have exact representations in binary "
"floating point. End users typically would not expect ``1.1 + 2.2`` to "
"display as :const:`3.3000000000000003` as it does with binary floating "
"point."
msgstr ""
"Decimal 数字的表示是精确的。 相比之下,:const:`1.1` 和 :const:`2.2` 这样则是不精确的二进制浮点数表示。 "
"最终用户通常不希望 ``1.1 + 2.2`` 的结果会如采用二进制浮点数时那样显示为 :const:`3.3000000000000003`。"
#: ../../library/decimal.rst:47
msgid ""
"The exactness carries over into arithmetic. In decimal floating point, "
"``0.1 + 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating "
"point, the result is :const:`5.5511151231257827e-017`. While near to zero, "
"the differences prevent reliable equality testing and differences can "
"accumulate. For this reason, decimal is preferred in accounting applications"
" which have strict equality invariants."
msgstr ""
"精确性会延续到算术类操作中。 对于 decimal 浮点数,``0.1 + 0.1 + 0.1 - 0.3`` 会精确地等于零。 "
"而对于二进制浮点数,结果则为 :const:`5.5511151231257827e-017` 。 "
"虽然接近于零,但其中的误差将妨碍可靠的相等性检验,并且误差还会不断累积。 因此,decimal 更适合具有严格相等不变性要求的会计类应用。"
#: ../../library/decimal.rst:54
msgid ""
"The decimal module incorporates a notion of significant places so that "
"``1.30 + 1.20`` is :const:`2.50`. The trailing zero is kept to indicate "
"significance. This is the customary presentation for monetary applications. "
"For multiplication, the \"schoolbook\" approach uses all the figures in the "
"multiplicands. For instance, ``1.3 * 1.2`` gives :const:`1.56` while ``1.30"
" * 1.20`` gives :const:`1.5600`."
msgstr ""
"decimal 模块包含了有效位的概念,使得 ``1.30 + 1.20`` 是 :const:`2.50` 。 保留尾随零以表示有效位。 "
"这是货币类应用的习惯表示法。 对于乘法,“教科书”方式使用被乘数中的所有数位。 例如, ``1.3 * 1.2`` 给出 :const:`1.56` 而"
" ``1.30 * 1.20`` 给出 :const:`1.5600` 。"
#: ../../library/decimal.rst:61
msgid ""
"Unlike hardware based binary floating point, the decimal module has a user "
"alterable precision (defaulting to 28 places) which can be as large as "
"needed for a given problem:"
msgstr "与基于硬件的二进制浮点数不同,decimal 模块具有用户可更改的精度(默认为28位),可以与给定问题所需的一样大:"
#: ../../library/decimal.rst:73
msgid ""
"Both binary and decimal floating point are implemented in terms of published"
" standards. While the built-in float type exposes only a modest portion of "
"its capabilities, the decimal module exposes all required parts of the "
"standard. When needed, the programmer has full control over rounding and "
"signal handling. This includes an option to enforce exact arithmetic by "
"using exceptions to block any inexact operations."
msgstr ""
"二进制和 decimal 浮点数都是根据已发布的标准实现的。 虽然内置浮点类型只公开其功能的一小部分,但 decimal 模块公开了标准的所有必需部分。"
" 在需要时,程序员可以完全控制舍入和信号处理。 这包括通过使用异常来阻止任何不精确操作来强制执行精确算术的选项。"
#: ../../library/decimal.rst:80
msgid ""
"The decimal module was designed to support \"without prejudice, both exact "
"unrounded decimal arithmetic (sometimes called fixed-point arithmetic) and "
"rounded floating-point arithmetic.\" -- excerpt from the decimal arithmetic"
" specification."
msgstr ""
"decimal 模块旨在支持“无偏差,精确无舍入的十进制算术(有时称为定点数算术)和有舍入的浮点数算术”。 —— 摘自 decimal 算术规范说明。"
#: ../../library/decimal.rst:85
msgid ""
"The module design is centered around three concepts: the decimal number, "
"the context for arithmetic, and signals."
msgstr "该模块的设计以三个概念为中心:decimal 数值,算术上下文和信号。"
#: ../../library/decimal.rst:88
msgid ""
"A decimal number is immutable. It has a sign, coefficient digits, and an "
"exponent. To preserve significance, the coefficient digits do not truncate "
"trailing zeros. Decimals also include special values such as "
":const:`Infinity`, :const:`-Infinity`, and :const:`NaN`. The standard also "
"differentiates :const:`-0` from :const:`+0`."
msgstr ""
"decimal 数值是不可变对象。 它由符号,系数和指数位组成。 为了保持有效位,系数位不会截去末尾零。 decimal 数值也包括特殊值例如 "
":const:`Infinity` ,:const:`-Infinity` 和 :const:`NaN` 。 该标准还区分 :const:`-0` 和 "
":const:`+0` 。"
#: ../../library/decimal.rst:94
msgid ""
"The context for arithmetic is an environment specifying precision, rounding "
"rules, limits on exponents, flags indicating the results of operations, and "
"trap enablers which determine whether signals are treated as exceptions. "
"Rounding options include :const:`ROUND_CEILING`, :const:`ROUND_DOWN`, "
":const:`ROUND_FLOOR`, :const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN`, "
":const:`ROUND_HALF_UP`, :const:`ROUND_UP`, and :const:`ROUND_05UP`."
msgstr ""
"算术的上下文是指定精度、舍入规则、指数限制、指示操作结果的标志以及确定符号是否被视为异常的陷阱启用器的环境。 舍入选项包括 "
":const:`ROUND_CEILING` 、 :const:`ROUND_DOWN` 、 :const:`ROUND_FLOOR` 、 "
":const:`ROUND_HALF_DOWN`, :const:`ROUND_HALF_EVEN` 、 :const:`ROUND_HALF_UP` "
"、 :const:`ROUND_UP` 以及 :const:`ROUND_05UP`."
#: ../../library/decimal.rst:101
msgid ""
"Signals are groups of exceptional conditions arising during the course of "
"computation. Depending on the needs of the application, signals may be "
"ignored, considered as informational, or treated as exceptions. The signals "
"in the decimal module are: :const:`Clamped`, :const:`InvalidOperation`, "
":const:`DivisionByZero`, :const:`Inexact`, :const:`Rounded`, "
":const:`Subnormal`, :const:`Overflow`, :const:`Underflow` and "
":const:`FloatOperation`."
msgstr ""
"信号是在计算过程中出现的异常条件组。 根据应用程序的需要,信号可能会被忽略,被视为信息,或被视为异常。 "
"十进制模块中的信号有::const:`Clamped` 、 :const:`InvalidOperation` 、 "
":const:`DivisionByZero` 、 :const:`Inexact` 、 :const:`Rounded` 、 "
":const:`Subnormal` 、 :const:`Overflow` 、 :const:`Underflow` 以及 "
":const:`FloatOperation` 。"
#: ../../library/decimal.rst:108
msgid ""
"For each signal there is a flag and a trap enabler. When a signal is "
"encountered, its flag is set to one, then, if the trap enabler is set to "
"one, an exception is raised. Flags are sticky, so the user needs to reset "
"them before monitoring a calculation."
msgstr ""
"对于每个信号,都有一个标志和一个陷阱启动器。 遇到信号时,其标志设置为 1 ,然后,如果陷阱启用器设置为 1 ,则引发异常。 "
"标志是粘性的,因此用户需要在监控计算之前重置它们。"
#: ../../library/decimal.rst:116
msgid ""
"IBM's General Decimal Arithmetic Specification, `The General Decimal "
"Arithmetic Specification <http://speleotrove.com/decimal/decarith.html>`_."
msgstr ""
"IBM 的通用十进制算术规范描述 `The General Decimal Arithmetic Specification "
"<http://speleotrove.com/decimal/decarith.html>`_。"
#: ../../library/decimal.rst:125
msgid "Quick-start Tutorial"
msgstr "快速入门教程"
#: ../../library/decimal.rst:127
msgid ""
"The usual start to using decimals is importing the module, viewing the "
"current context with :func:`getcontext` and, if necessary, setting new "
"values for precision, rounding, or enabled traps::"
msgstr ""
"通常使用 decimal 的方式是先导入该模块,通过 :func:`getcontext` "
"查看当前上下文,并在必要时为精度、舍入或启用的陷阱设置新值::"
#: ../../library/decimal.rst:139
msgid ""
"Decimal instances can be constructed from integers, strings, floats, or "
"tuples. Construction from an integer or a float performs an exact conversion"
" of the value of that integer or float. Decimal numbers include special "
"values such as :const:`NaN` which stands for \"Not a number\", positive and "
"negative :const:`Infinity`, and :const:`-0`::"
msgstr ""
"可以基于整数、字符串、浮点数或元组构造 Decimal 实例。 基于整数或浮点数构造将执行该整数或浮点值的精确转换。 Decimal 数字包括特殊值例如"
" :const:`NaN` 表示“非数字”,正的和负的 :const:`Infinity` 和 :const:`-0` ::"
#: ../../library/decimal.rst:163
msgid ""
"If the :exc:`FloatOperation` signal is trapped, accidental mixing of "
"decimals and floats in constructors or ordering comparisons raises an "
"exception::"
msgstr "如果 :exc:`FloatOperation` 信号被捕获,构造函数中的小数和浮点数的意外混合或排序比较会引发异常 ::"
#: ../../library/decimal.rst:182
msgid ""
"The significance of a new Decimal is determined solely by the number of "
"digits input. Context precision and rounding only come into play during "
"arithmetic operations."
msgstr "新 Decimal 的重要性仅由输入的位数决定。 上下文精度和舍入仅在算术运算期间发挥作用。"
#: ../../library/decimal.rst:199
msgid ""
"If the internal limits of the C version are exceeded, constructing a decimal"
" raises :class:`InvalidOperation`::"
msgstr "如果超出了 C 版本的内部限制,则构造一个 decimal 将引发 :class:`InvalidOperation` ::"
#: ../../library/decimal.rst:209
msgid ""
"Decimals interact well with much of the rest of Python. Here is a small "
"decimal floating point flying circus:"
msgstr "Decimal 数字能很好地与 Python 的其余部分交互。 以下是一个小小的 decimal 浮点数飞行马戏团:"
#: ../../library/decimal.rst:241
msgid "And some mathematical functions are also available to Decimal:"
msgstr "Decimal 也可以使用一些数学函数:"
#: ../../library/decimal.rst:253
msgid ""
"The :meth:`quantize` method rounds a number to a fixed exponent. This "
"method is useful for monetary applications that often round results to a "
"fixed number of places:"
msgstr ":meth:`quantize` 方法将数字四舍五入为固定指数。 此方法对于将结果舍入到固定的位置的货币应用程序非常有用:"
#: ../../library/decimal.rst:262
msgid ""
"As shown above, the :func:`getcontext` function accesses the current context"
" and allows the settings to be changed. This approach meets the needs of "
"most applications."
msgstr "如上所示,:func:`getcontext` 函数访问当前上下文并允许更改设置。 这种方法满足大多数应用程序的需求。"
#: ../../library/decimal.rst:266
msgid ""
"For more advanced work, it may be useful to create alternate contexts using "
"the Context() constructor. To make an alternate active, use the "
":func:`setcontext` function."
msgstr ""
"对于更高级的工作,使用 Context() 构造函数创建备用上下文可能很有用。 要使用备用活动,请使用 :func:`setcontext` 函数。"
#: ../../library/decimal.rst:270
msgid ""
"In accordance with the standard, the :mod:`decimal` module provides two "
"ready to use standard contexts, :const:`BasicContext` and "
":const:`ExtendedContext`. The former is especially useful for debugging "
"because many of the traps are enabled:"
msgstr ""
"根据标准,:mod:`decimal` 模块提供了两个现成的标准上下文 :const:`BasicContext` 和 "
":const:`ExtendedContext` 。 前者对调试特别有用,因为许多陷阱都已启用:"
#: ../../library/decimal.rst:299
msgid ""
"Contexts also have signal flags for monitoring exceptional conditions "
"encountered during computations. The flags remain set until explicitly "
"cleared, so it is best to clear the flags before each set of monitored "
"computations by using the :meth:`clear_flags` method. ::"
msgstr ""
"上下文还具有用于监视计算期间遇到的异常情况的信号标志。 标志保持设置直到明确清除,因此最好通过使用 :meth:`clear_flags` "
"方法清除每组受监控计算之前的标志。::"
#: ../../library/decimal.rst:312
msgid ""
"The *flags* entry shows that the rational approximation to :const:`Pi` was "
"rounded (digits beyond the context precision were thrown away) and that the "
"result is inexact (some of the discarded digits were non-zero)."
msgstr ""
"*flags* 条目显示对 :const:`Pi` 的有理逼近被舍入(超出上下文精度的数字被抛弃)并且结果是不精确的(一些丢弃的数字不为零)。"
#: ../../library/decimal.rst:316
msgid ""
"Individual traps are set using the dictionary in the :attr:`traps` field of "
"a context:"
msgstr "使用上下文的 :attr:`traps` 字段中的字典设置单个陷阱:"
#: ../../library/decimal.rst:331
msgid ""
"Most programs adjust the current context only once, at the beginning of the "
"program. And, in many applications, data is converted to :class:`Decimal` "
"with a single cast inside a loop. With context set and decimals created, "
"the bulk of the program manipulates the data no differently than with other "
"Python numeric types."
msgstr ""
"大多数程序仅在程序开始时调整当前上下文一次。 并且,在许多应用程序中,数据在循环内单个强制转换为 :class:`Decimal` 。 "
"通过创建上下文集和小数,程序的大部分操作数据与其他 Python 数字类型没有区别。"
#: ../../library/decimal.rst:343
msgid "Decimal objects"
msgstr "Decimal 对象"
#: ../../library/decimal.rst:348
msgid "Construct a new :class:`Decimal` object based from *value*."
msgstr "根据 *value* 构造一个新的 :class:`Decimal` 对象。"
#: ../../library/decimal.rst:350
msgid ""
"*value* can be an integer, string, tuple, :class:`float`, or another "
":class:`Decimal` object. If no *value* is given, returns ``Decimal('0')``. "
"If *value* is a string, it should conform to the decimal numeric string "
"syntax after leading and trailing whitespace characters, as well as "
"underscores throughout, are removed::"
msgstr ""
"*value* 可以是整数,字符串,元组,:class:`float` ,或另一个 :class:`Decimal` 对象。 如果没有给出 "
"*value*,则返回 ``Decimal('0')``。 如果 *value* "
"是一个字符串,它应该在前导和尾随空格字符以及下划线被删除之后符合十进制数字字符串语法::"
#: ../../library/decimal.rst:366
msgid ""
"Other Unicode decimal digits are also permitted where ``digit`` appears "
"above. These include decimal digits from various other alphabets (for "
"example, Arabic-Indic and Devanāgarī digits) along with the fullwidth digits"
" ``'\\uff10'`` through ``'\\uff19'``."
msgstr ""
"当上面出现 ``digit`` 时也允许其他十进制数码。 其中包括来自各种其他语言系统的十进制数码(例如阿拉伯-印地语和天城文的数码)以及全宽数码 "
"``'\\uff10'`` 到 ``'\\uff19'``。"
#: ../../library/decimal.rst:371
msgid ""
"If *value* is a :class:`tuple`, it should have three components, a sign "
"(:const:`0` for positive or :const:`1` for negative), a :class:`tuple` of "
"digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), "
"-3))`` returns ``Decimal('1.414')``."
msgstr ""
"如果 *value* 是一个 :class:`tuple` ,它应该有三个组件,一个符号( :const:`0` 表示正数或 :const:`1` "
"表示负数),一个数字的 :class:`tuple` 和整数指数。 例如, ``Decimal((0, (1, 4, 1, 4), -3))`` 返回 "
"``Decimal('1.414')``。"
#: ../../library/decimal.rst:376
msgid ""
"If *value* is a :class:`float`, the binary floating point value is "
"losslessly converted to its exact decimal equivalent. This conversion can "
"often require 53 or more digits of precision. For example, "
"``Decimal(float('1.1'))`` converts to "
"``Decimal('1.100000000000000088817841970012523233890533447265625')``."
msgstr ""
"如果 *value* 是 :class:`float` ,则二进制浮点值无损地转换为其精确的十进制等效值。 此转换通常需要53位或更多位数的精度。 "
"例如, ``Decimal(float('1.1'))`` "
"转换为``Decimal('1.100000000000000088817841970012523233890533447265625')``。"
#: ../../library/decimal.rst:382
msgid ""
"The *context* precision does not affect how many digits are stored. That is "
"determined exclusively by the number of digits in *value*. For example, "
"``Decimal('3.00000')`` records all five zeros even if the context precision "
"is only three."
msgstr ""
"*context* 精度不会影响存储的位数。 这完全由 *value* 中的位数决定。 例如,``Decimal('3.00000')`` "
"记录所有五个零,即使上下文精度只有三。"
#: ../../library/decimal.rst:387
msgid ""
"The purpose of the *context* argument is determining what to do if *value* "
"is a malformed string. If the context traps :const:`InvalidOperation`, an "
"exception is raised; otherwise, the constructor returns a new Decimal with "
"the value of :const:`NaN`."
msgstr ""
"*context* 参数的目的是确定 *value* 是格式错误的字符串时该怎么做。 如果上下文陷阱 "
":const:`InvalidOperation`,则引发异常;否则,构造函数返回一个新的 Decimal,其值为 :const:`NaN`。"
#: ../../library/decimal.rst:392
msgid "Once constructed, :class:`Decimal` objects are immutable."
msgstr "构造完成后, :class:`Decimal` 对象是不可变的。"
#: ../../library/decimal.rst:394
msgid ""
"The argument to the constructor is now permitted to be a :class:`float` "
"instance."
msgstr "现在允许构造函数的参数为 :class:`float` 实例。"
#: ../../library/decimal.rst:398
msgid ""
":class:`float` arguments raise an exception if the :exc:`FloatOperation` "
"trap is set. By default the trap is off."
msgstr ":class:`float` 参数在设置 :exc:`FloatOperation` 陷阱时引发异常。 默认情况下,陷阱已关闭。"
#: ../../library/decimal.rst:402
msgid ""
"Underscores are allowed for grouping, as with integral and floating-point "
"literals in code."
msgstr "允许下划线进行分组,就像代码中的整数和浮点文字一样。"
#: ../../library/decimal.rst:406
msgid ""
"Decimal floating point objects share many properties with the other built-in"
" numeric types such as :class:`float` and :class:`int`. All of the usual "
"math operations and special methods apply. Likewise, decimal objects can be"
" copied, pickled, printed, used as dictionary keys, used as set elements, "
"compared, sorted, and coerced to another type (such as :class:`float` or "
":class:`int`)."
msgstr ""
"十进制浮点对象与其他内置数值类型共享许多属性,例如 :class:`float` 和 :class:`int` 。 所有常用的数学运算和特殊方法都适用。"
" 同样,十进制对象可以复制、pickle、打印、用作字典键、用作集合元素、比较、排序和强制转换为另一种类型(例如 :class:`float` 或 "
":class:`int` )。"
#: ../../library/decimal.rst:413
msgid ""
"There are some small differences between arithmetic on Decimal objects and "
"arithmetic on integers and floats. When the remainder operator ``%`` is "
"applied to Decimal objects, the sign of the result is the sign of the "
"*dividend* rather than the sign of the divisor::"
msgstr ""
"算术对十进制对象和算术对整数和浮点数有一些小的差别。 当余数运算符 ``%`` 应用于Decimal对象时,结果的符号是 *被除数* "
"的符号,而不是除数的符号::"
#: ../../library/decimal.rst:423
msgid ""
"The integer division operator ``//`` behaves analogously, returning the "
"integer part of the true quotient (truncating towards zero) rather than its "
"floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::"
msgstr ""
"整数除法运算符 ``//`` 的行为类似,返回真商的整数部分(截断为零)而不是它的向下取整,以便保留通常的标识 ``x == (x // y) * y "
"+ x % y``::"
#: ../../library/decimal.rst:432
msgid ""
"The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-"
"integer`` operations (respectively) as described in the specification."
msgstr ""
"``%`` 和 ``//`` 运算符实现了 ``remainder`` 和 ``divide-integer`` 操作(分别),如规范中所述。"
#: ../../library/decimal.rst:436
msgid ""
"Decimal objects cannot generally be combined with floats or instances of "
":class:`fractions.Fraction` in arithmetic operations: an attempt to add a "
":class:`Decimal` to a :class:`float`, for example, will raise a "
":exc:`TypeError`. However, it is possible to use Python's comparison "
"operators to compare a :class:`Decimal` instance ``x`` with another number "
"``y``. This avoids confusing results when doing equality comparisons "
"between numbers of different types."
msgstr ""
"十进制对象通常不能与浮点数或 :class:`fractions.Fraction` 实例在算术运算中结合使用:例如,尝试将 "
":class:`Decimal` 加到 :class:`float` ,将引发 :exc:`TypeError`。 但是,可以使用 Python "
"的比较运算符来比较 :class:`Decimal` 实例 ``x`` 和另一个数字 ``y`` 。 "
"这样可以避免在对不同类型的数字进行相等比较时混淆结果。"
#: ../../library/decimal.rst:444
msgid ""
"Mixed-type comparisons between :class:`Decimal` instances and other numeric "
"types are now fully supported."
msgstr "现在完全支持 :class:`Decimal` 实例和其他数字类型之间的混合类型比较。"
#: ../../library/decimal.rst:448
msgid ""
"In addition to the standard numeric properties, decimal floating point "
"objects also have a number of specialized methods:"
msgstr "除了标准的数字属性,十进制浮点对象还有许多专门的方法:"
#: ../../library/decimal.rst:454
msgid ""
"Return the adjusted exponent after shifting out the coefficient's rightmost "
"digits until only the lead digit remains: ``Decimal('321e+5').adjusted()`` "
"returns seven. Used for determining the position of the most significant "
"digit with respect to the decimal point."
msgstr ""
"在移出系数最右边的数字之后返回调整后的指数,直到只剩下前导数字:``Decimal('321e+5').adjusted()`` 返回 7 。 "
"用于确定最高有效位相对于小数点的位置。"
#: ../../library/decimal.rst:461
msgid ""
"Return a pair ``(n, d)`` of integers that represent the given "
":class:`Decimal` instance as a fraction, in lowest terms and with a positive"
" denominator::"
msgstr "返回一对 ``(n, d)`` 整数,表示给定的 :class:`Decimal` 实例作为分数、最简形式项并带有正分母::"
#: ../../library/decimal.rst:468
msgid ""
"The conversion is exact. Raise OverflowError on infinities and ValueError "
"on NaNs."
msgstr "转换是精确的。 在 Infinity 上引发 OverflowError ,在 NaN 上引起 ValueError 。"
#: ../../library/decimal.rst:475
msgid ""
"Return a :term:`named tuple` representation of the number: "
"``DecimalTuple(sign, digits, exponent)``."
msgstr ""
"返回一个 :term:`named tuple` 表示的数字: ``DecimalTuple(sign, digits, exponent)``。"
#: ../../library/decimal.rst:481
msgid ""
"Return the canonical encoding of the argument. Currently, the encoding of a"
" :class:`Decimal` instance is always canonical, so this operation returns "
"its argument unchanged."
msgstr "返回参数的规范编码。 目前,一个 :class:`Decimal` 实例的编码始终是规范的,因此该操作返回其参数不变。"
#: ../../library/decimal.rst:487
msgid ""
"Compare the values of two Decimal instances. :meth:`compare` returns a "
"Decimal instance, and if either operand is a NaN then the result is a NaN::"
msgstr ""
"比较两个 Decimal 实例的值。 :meth:`compare` 返回一个 Decimal 实例,如果任一操作数是 NaN ,那么结果是 NaN "
"::"
#: ../../library/decimal.rst:498
msgid ""
"This operation is identical to the :meth:`compare` method, except that all "
"NaNs signal. That is, if neither operand is a signaling NaN then any quiet "
"NaN operand is treated as though it were a signaling NaN."
msgstr ""
"除了所有 NaN 信号之外,此操作与 :meth:`compare` 方法相同。 也就是说,如果两个操作数都不是信令NaN,那么任何静默的 NaN "
"操作数都被视为信令NaN。"
#: ../../library/decimal.rst:504
msgid ""
"Compare two operands using their abstract representation rather than their "
"numerical value. Similar to the :meth:`compare` method, but the result "
"gives a total ordering on :class:`Decimal` instances. Two :class:`Decimal` "
"instances with the same numeric value but different representations compare "
"unequal in this ordering:"
msgstr ""
"使用它们的抽象表示而不是它们的数值来比较两个操作数。 类似于 :meth:`compare` 方法,但结果给出了一个总排序 "
":class:`Decimal` 实例。 两个 :class:`Decimal` 实例具有相同的数值但不同的表示形式在此排序中比较不相等:"
#: ../../library/decimal.rst:513
msgid ""
"Quiet and signaling NaNs are also included in the total ordering. The "
"result of this function is ``Decimal('0')`` if both operands have the same "
"representation, ``Decimal('-1')`` if the first operand is lower in the total"
" order than the second, and ``Decimal('1')`` if the first operand is higher "
"in the total order than the second operand. See the specification for "
"details of the total order."
msgstr ""
"静默和发出信号的 NaN 也包括在总排序中。 这个函数的结果是 ``Decimal('0')`` 如果两个操作数具有相同的表示,或是 "
"``Decimal('-1')`` 如果第一个操作数的总顺序低于第二个操作数,或是 ``Decimal('1')`` "
"如果第一个操作数在总顺序中高于第二个操作数。 有关总排序的详细信息,请参阅规范。"
#: ../../library/decimal.rst:520 ../../library/decimal.rst:531
#: ../../library/decimal.rst:559 ../../library/decimal.rst:834
msgid ""
"This operation is unaffected by context and is quiet: no flags are changed "
"and no rounding is performed. As an exception, the C version may raise "
"InvalidOperation if the second operand cannot be converted exactly."
msgstr ""
"此操作不受上下文影响且静默:不更改任何标志且不执行舍入。 作为例外,如果无法准确转换第二个操作数,则C版本可能会引发InvalidOperation。"
#: ../../library/decimal.rst:526
msgid ""
"Compare two operands using their abstract representation rather than their "
"value as in :meth:`compare_total`, but ignoring the sign of each operand. "
"``x.compare_total_mag(y)`` is equivalent to "
"``x.copy_abs().compare_total(y.copy_abs())``."
msgstr ""
"比较两个操作数使用它们的抽象表示而不是它们的值,如 :meth:`compare_total`,但忽略每个操作数的符号。 "
"``x.compare_total_mag(y)`` 相当于 ``x.copy_abs().compare_total(y.copy_abs())``。"
#: ../../library/decimal.rst:537
msgid ""
"Just returns self, this method is only to comply with the Decimal "
"Specification."
msgstr "只返回self,这种方法只符合 Decimal 规范。"
#: ../../library/decimal.rst:542
msgid ""
"Return the absolute value of the argument. This operation is unaffected by "
"the context and is quiet: no flags are changed and no rounding is performed."
msgstr "返回参数的绝对值。 此操作不受上下文影响并且是静默的:没有更改标志且不执行舍入。"
#: ../../library/decimal.rst:548
msgid ""
"Return the negation of the argument. This operation is unaffected by the "
"context and is quiet: no flags are changed and no rounding is performed."
msgstr "回到参数的否定。 此操作不受上下文影响并且是静默的:没有标志更改且不执行舍入。"
#: ../../library/decimal.rst:553
msgid ""
"Return a copy of the first operand with the sign set to be the same as the "
"sign of the second operand. For example:"
msgstr "返回第一个操作数的副本,其符号设置为与第二个操作数的符号相同。 例如:"
#: ../../library/decimal.rst:565
msgid ""
"Return the value of the (natural) exponential function ``e**x`` at the given"
" number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN`"
" rounding mode."
msgstr "返回给定数字的(自然)指数函数``e**x``的值。结果使用 :const:`ROUND_HALF_EVEN` 舍入模式正确舍入。"
#: ../../library/decimal.rst:576
msgid "Classmethod that converts a float to a decimal number, exactly."
msgstr "将浮点数转换为十进制数的类方法。"
#: ../../library/decimal.rst:578
msgid ""
"Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. Since "
"0.1 is not exactly representable in binary floating point, the value is "
"stored as the nearest representable value which is `0x1.999999999999ap-4`. "
"That equivalent value in decimal is "
"`0.1000000000000000055511151231257827021181583404541015625`."
msgstr ""
"注意, `Decimal.from_float(0.1)` 与 `Decimal('0.1')` 不同。 由于 0.1 "
"在二进制浮点中不能精确表示,因此该值存储为最接近的可表示值,即 `0x1.999999999999ap-4` 。 "
"十进制的等效值是`0.1000000000000000055511151231257827021181583404541015625`。"
#: ../../library/decimal.rst:584
msgid ""
"From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed"
" directly from a :class:`float`."
msgstr "从 Python 3.2 开始,:class:`Decimal` 实例也可以直接从 :class:`float` 构造。"
#: ../../library/decimal.rst:602
msgid ""
"Fused multiply-add. Return self*other+third with no rounding of the "
"intermediate product self*other."
msgstr "混合乘法加法。 返回 self*other+third ,中间乘积 self*other 没有四舍五入。"
#: ../../library/decimal.rst:610
msgid ""
"Return :const:`True` if the argument is canonical and :const:`False` "
"otherwise. Currently, a :class:`Decimal` instance is always canonical, so "
"this operation always returns :const:`True`."
msgstr ""
"如果参数是规范的,则为返回 :const:`True`,否则为 :const:`False` 。 目前,:class:`Decimal` "
"实例总是规范的,所以这个操作总是返回 :const:`True` 。"
#: ../../library/decimal.rst:616
msgid ""
"Return :const:`True` if the argument is a finite number, and :const:`False` "
"if the argument is an infinity or a NaN."
msgstr "如果参数是一个有限的数,则返回为 :const:`True` ;如果参数为无穷大或 NaN ,则返回为 :const:`False`。"
#: ../../library/decimal.rst:621
msgid ""
"Return :const:`True` if the argument is either positive or negative infinity"
" and :const:`False` otherwise."
msgstr "如果参数为正负无穷大,则返回为 :const:`True` ,否则为 :const:`False` 。"
#: ../../library/decimal.rst:626
msgid ""
"Return :const:`True` if the argument is a (quiet or signaling) NaN and "
":const:`False` otherwise."
msgstr "如果参数为 NaN (无论是否静默),则返回为 :const:`True` ,否则为 :const:`False` 。"
#: ../../library/decimal.rst:631
msgid ""
"Return :const:`True` if the argument is a *normal* finite number. Return "
":const:`False` if the argument is zero, subnormal, infinite or a NaN."
msgstr "如果参数是一个有限正规数,返回 :const:`True`,如果参数是0、次正规数、无穷大或是NaN,返回 :const:`False`。"
#: ../../library/decimal.rst:636
msgid ""
"Return :const:`True` if the argument is a quiet NaN, and :const:`False` "
"otherwise."
msgstr "如果参数为静默 NaN,返回 :const:`True`,否则返回 :const:`False`。"
#: ../../library/decimal.rst:641
msgid ""
"Return :const:`True` if the argument has a negative sign and :const:`False` "
"otherwise. Note that zeros and NaNs can both carry signs."
msgstr "如果参数带有负号,则返回为 :const:`True`,否则返回 :const:`False`。注意,0 和 NaN 都可带有符号。"
#: ../../library/decimal.rst:646
msgid ""
"Return :const:`True` if the argument is a signaling NaN and :const:`False` "
"otherwise."
msgstr "如果参数为显式 NaN,则返回 :const:`True`,否则返回 :const:`False`。"
#: ../../library/decimal.rst:651
msgid ""
"Return :const:`True` if the argument is subnormal, and :const:`False` "
"otherwise."
msgstr "如果参数为次正规数,则返回 :const:`True`,否则返回 :const:`False`。"
#: ../../library/decimal.rst:656
msgid ""
"Return :const:`True` if the argument is a (positive or negative) zero and "
":const:`False` otherwise."
msgstr "如果参数是0(正负皆可),则返回 :const:`True`,否则返回 :const:`False`。"
#: ../../library/decimal.rst:661
msgid ""
"Return the natural (base e) logarithm of the operand. The result is "
"correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode."
msgstr "返回操作数的自然对数(以 e 为底)。结果是使用 :const:`ROUND_HALF_EVEN` 舍入模式正确四舍五入的。"
#: ../../library/decimal.rst:666
msgid ""
"Return the base ten logarithm of the operand. The result is correctly "
"rounded using the :const:`ROUND_HALF_EVEN` rounding mode."
msgstr "返回操作数的以十为底的对数。结果是使用 :const:`ROUND_HALF_EVEN` 舍入模式正确四舍五入的。"
#: ../../library/decimal.rst:671
msgid ""
"For a nonzero number, return the adjusted exponent of its operand as a "
":class:`Decimal` instance. If the operand is a zero then "
"``Decimal('-Infinity')`` is returned and the :const:`DivisionByZero` flag is"
" raised. If the operand is an infinity then ``Decimal('Infinity')`` is "
"returned."
msgstr ""
"对于一个非零数,返回其运算数的调整后指数作为一个 :class:`Decimal` 实例。 如果运算数为零将返回 "
"``Decimal('-Infinity')`` 并且产生 the :const:`DivisionByZero` 标志。如果运算数是无限大则返回 "
"``Decimal('Infinity')`` 。"
#: ../../library/decimal.rst:679
msgid ""
":meth:`logical_and` is a logical operation which takes two *logical "
"operands* (see :ref:`logical_operands_label`). The result is the digit-wise"
" ``and`` of the two operands."
msgstr ""
":meth:`logical_and` 是需要两个 *逻辑运算数* 的逻辑运算(参考 :ref:`logical_operands_label` "
")。结果是按位输出的两运算数的 “和”。"
#: ../../library/decimal.rst:685
msgid ""
":meth:`logical_invert` is a logical operation. The result is the digit-wise"
" inversion of the operand."
msgstr ":meth:`logical_invert` 是一个逻辑运算。 结果是按位的倒转的运算数。"
#: ../../library/decimal.rst:690
msgid ""
":meth:`logical_or` is a logical operation which takes two *logical operands*"
" (see :ref:`logical_operands_label`). The result is the digit-wise ``or`` "
"of the two operands."
msgstr ""
":meth:`logical_or` 是需要两个 *logical operands* 的逻辑运算(请参阅 "
":ref:`logical_operands_label` )。结果是两个运算数的按位的 ``or`` 。"
#: ../../library/decimal.rst:696
msgid ""
":meth:`logical_xor` is a logical operation which takes two *logical "
"operands* (see :ref:`logical_operands_label`). The result is the digit-wise"
" exclusive or of the two operands."
msgstr ""
":meth:`logical_xor` 是需要两个 *逻辑运算数* 的逻辑运算(参考 :ref:`logical_operands_label` "
")。结果是按位输出的两运算数的异或运算。"
#: ../../library/decimal.rst:702
msgid ""
"Like ``max(self, other)`` except that the context rounding rule is applied "
"before returning and that :const:`NaN` values are either signaled or ignored"
" (depending on the context and whether they are signaling or quiet)."
msgstr ""
"像 ``max(self, other)`` 一样,除了在返回之前应用上下文舍入规则并且用信号通知或忽略 :const:`NaN` "
"值(取决于上下文以及它们是发信号还是安静)。"
#: ../../library/decimal.rst:709
msgid ""
"Similar to the :meth:`.max` method, but the comparison is done using the "
"absolute values of the operands."
msgstr "与 :meth:`.max` 方法相似,但是操作数使用绝对值进行比较。"
#: ../../library/decimal.rst:714
msgid ""
"Like ``min(self, other)`` except that the context rounding rule is applied "
"before returning and that :const:`NaN` values are either signaled or ignored"
" (depending on the context and whether they are signaling or quiet)."
msgstr ""
"像 ``min(self, other)`` 一样,除了在返回之前应用上下文舍入规则并且用信号通知或忽略 :const:`NaN` "
"值(取决于上下文以及它们是发信号还是安静)。"
#: ../../library/decimal.rst:721
msgid ""
"Similar to the :meth:`.min` method, but the comparison is done using the "
"absolute values of the operands."
msgstr "与 :meth:`.min` 方法相似,但是操作数使用绝对值进行比较。"
#: ../../library/decimal.rst:726
msgid ""
"Return the largest number representable in the given context (or in the "
"current thread's context if no context is given) that is smaller than the "
"given operand."
msgstr "返回小于给定操作数的上下文中可表示的最大数字(或者当前线程的上下文中的可表示的最大数字如果没有给定上下文)。"
#: ../../library/decimal.rst:732
msgid ""
"Return the smallest number representable in the given context (or in the "
"current thread's context if no context is given) that is larger than the "
"given operand."
msgstr "返回大于给定操作数的上下文中可表示的最小数字(或者当前线程的上下文中的可表示的最小数字如果没有给定上下文)。"
#: ../../library/decimal.rst:738
msgid ""
"If the two operands are unequal, return the number closest to the first "
"operand in the direction of the second operand. If both operands are "
"numerically equal, return a copy of the first operand with the sign set to "
"be the same as the sign of the second operand."
msgstr ""
"如果两运算数不相等,返回在第二个操作数的方向上最接近第一个操作数的数。如果两操作数数值上相等,返回将符号设置为与第二个运算数相同的第一个运算数的拷贝。"
#: ../../library/decimal.rst:745
msgid ""
"Normalize the number by stripping the rightmost trailing zeros and "
"converting any result equal to :const:`Decimal('0')` to "
":const:`Decimal('0e0')`. Used for producing canonical values for attributes "
"of an equivalence class. For example, ``Decimal('32.100')`` and "
"``Decimal('0.321000e+2')`` both normalize to the equivalent value "
"``Decimal('32.1')``."
msgstr ""
"通过去除尾随的零并将所有结果等于 :const:`Decimal('0')` 的转化为 :const:`Decimal('0e0')` "
"来标准化数字。用于为等效类的属性生成规范值。比如, ``Decimal('32.100')`` 和 ``Decimal('0.321000e+2')``"
" 都被标准化为相同的值 ``Decimal('32.1')``。"
#: ../../library/decimal.rst:754
msgid ""
"Return a string describing the *class* of the operand. The returned value "
"is one of the following ten strings."
msgstr "返回一个字符串描述运算数的 *class* 。返回值是以下十个字符串中的一个。"
#: ../../library/decimal.rst:757
msgid "``\"-Infinity\"``, indicating that the operand is negative infinity."
msgstr "``\"-Infinity\"`` ,指示操作数为负无穷大。"
#: ../../library/decimal.rst:758
msgid "``\"-Normal\"``, indicating that the operand is a negative normal number."
msgstr "``\"-Normal\"`` ,指示该操作数是负正常数字。"
#: ../../library/decimal.rst:759
msgid "``\"-Subnormal\"``, indicating that the operand is negative and subnormal."
msgstr "``\"-Subnormal\"`` ,指示该操作数是负的次正规数。"
#: ../../library/decimal.rst:760
msgid "``\"-Zero\"``, indicating that the operand is a negative zero."
msgstr "``\"-Zero\"`` ,指示该操作数是负零。"
#: ../../library/decimal.rst:761
msgid "``\"+Zero\"``, indicating that the operand is a positive zero."
msgstr "``\"-Zero\"`` ,指示该操作数是正零。"
#: ../../library/decimal.rst:762
msgid "``\"+Subnormal\"``, indicating that the operand is positive and subnormal."
msgstr "``\"+Subnormal\"`` ,指示该操作数是正的次正规数。"
#: ../../library/decimal.rst:763
msgid "``\"+Normal\"``, indicating that the operand is a positive normal number."
msgstr "``\"+Normal\"`` ,指示该操作数是正的正规数。"
#: ../../library/decimal.rst:764
msgid "``\"+Infinity\"``, indicating that the operand is positive infinity."
msgstr "``\"+Infinity\"`` ,指示该运算数是正无穷。"
#: ../../library/decimal.rst:765
msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)."
msgstr "``\"NaN\"`` ,指示该运算数是沉寂的 NaN (非数字)。"
#: ../../library/decimal.rst:766
msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN."
msgstr "``\"sNaN\"`` ,指示该运算数是信号 NaN 。"
#: ../../library/decimal.rst:770
msgid ""
"Return a value equal to the first operand after rounding and having the "
"exponent of the second operand."
msgstr "返回的值等于四舍五入的第一个运算数并且具有第二个操作数的指数。"
#: ../../library/decimal.rst:776
msgid ""
"Unlike other operations, if the length of the coefficient after the quantize"
" operation would be greater than precision, then an "
":const:`InvalidOperation` is signaled. This guarantees that, unless there is"
" an error condition, the quantized exponent is always equal to that of the "
"right-hand operand."
msgstr ""
"与其他运算不同,如果量化运算后的系数长度大于精度,那么会发出一个 :const:`InvalidOperation` "
"信号。这保证了除非有一个错误情况,量化指数恒等于右手运算数的指数。"
#: ../../library/decimal.rst:782
msgid ""
"Also unlike other operations, quantize never signals Underflow, even if the "
"result is subnormal and inexact."
msgstr "与其他运算不同,量化永不信号下溢,即使结果不正常且不精确。"
#: ../../library/decimal.rst:785
msgid ""
"If the exponent of the second operand is larger than that of the first then "
"rounding may be necessary. In this case, the rounding mode is determined by"
" the ``rounding`` argument if given, else by the given ``context`` argument;"
" if neither argument is given the rounding mode of the current thread's "
"context is used."
msgstr ""
"如果第二个运算数的指数大于第一个运算数的指数那或许需要四舍五入。在这种情况下,舍入模式由给定 ``rounding`` 参数决定,其余的由给定 "
"``context`` 参数决定;如果参数都未给定,使用当前线程上下文的舍入模式。"
#: ../../library/decimal.rst:791
msgid ""
"An error is returned whenever the resulting exponent is greater than "
":attr:`Emax` or less than :attr:`Etiny`."
msgstr "每当结果的指数大于 :attr:`Emax` 或小于 :attr:`Etiny` 就会返回错误。"
#: ../../library/decimal.rst:796
msgid ""
"Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class"
" does all its arithmetic. Included for compatibility with the "
"specification."
msgstr ""
"返回 ``Decimal(10)``,即 :class:`Decimal` 类进行所有算术运算所用的数制(基数)。 "
"这是为保持与规范描述的兼容性而加入的。"
#: ../../library/decimal.rst:802
msgid ""
"Return the remainder from dividing *self* by *other*. This differs from "
"``self % other`` in that the sign of the remainder is chosen so as to "
"minimize its absolute value. More precisely, the return value is ``self - n"
" * other`` where ``n`` is the integer nearest to the exact value of ``self /"
" other``, and if two integers are equally near then the even one is chosen."
msgstr ""
"返回 *self* 除以 *other* 的余数。 这与 ``self % other`` 的区别在于所选择的余数要使其绝对值最小化。 "
"更准确地说,返回值为 ``self - n * other`` 其中 ``n`` 是最接近 ``self / other`` "
"的实际值的整数,并且如果两个整数与实际值的差相等则会选择其中的偶数。"
#: ../../library/decimal.rst:809
msgid "If the result is zero then its sign will be the sign of *self*."
msgstr "如果结果为零则其符号将为 *self* 的符号。"
#: ../../library/decimal.rst:820
msgid ""
"Return the result of rotating the digits of the first operand by an amount "
"specified by the second operand. The second operand must be an integer in "
"the range -precision through precision. The absolute value of the second "
"operand gives the number of places to rotate. If the second operand is "
"positive then rotation is to the left; otherwise rotation is to the right. "
"The coefficient of the first operand is padded on the left with zeros to "
"length precision if necessary. The sign and exponent of the first operand "
"are unchanged."
msgstr ""
"返回对第一个操作数的数码按第二个操作数所指定的数量进行轮转的结果。 第二个操作数必须为 -precision 至 precision 精度范围内的整数。"
" 第二个操作数的绝对值给出要轮转的位数。 如果第二个操作数为正值则向左轮转;否则向右轮转。 如有必要第一个操作数的系数会在左侧填充零以达到 "
"precision 所指定的长度。 第一个操作数的符号和指数保持不变。"
#: ../../library/decimal.rst:831
msgid ""
"Test whether self and other have the same exponent or whether both are "
":const:`NaN`."
msgstr "检测自身与 other 是否具有相同的指数或是否均为 :const:`NaN`。"
#: ../../library/decimal.rst:840
msgid ""
"Return the first operand with exponent adjusted by the second. Equivalently,"
" return the first operand multiplied by ``10**other``. The second operand "
"must be an integer."
msgstr ""
"返回第一个操作数使用第二个操作数对指数进行调整的结果。 等价于返回第一个操作数乘以 ``10**other`` 的结果。 第二个操作数必须为整数。"
#: ../../library/decimal.rst:846
msgid ""
"Return the result of shifting the digits of the first operand by an amount "
"specified by the second operand. The second operand must be an integer in "
"the range -precision through precision. The absolute value of the second "
"operand gives the number of places to shift. If the second operand is "
"positive then the shift is to the left; otherwise the shift is to the right."
" Digits shifted into the coefficient are zeros. The sign and exponent of "
"the first operand are unchanged."
msgstr ""
"返回第一个操作数的数码按第二个操作数所指定的数量进行移位的结果。 第二个操作数必须为 -precision 至 precision 范围内的整数。 "
"第二个操作数的绝对值给出要移动的位数。 如果第二个操作数为正值则向左移位;否则向右移位。 移入系数的数码为零。 第一个操作数的符号和指数保持不变。"
#: ../../library/decimal.rst:856
msgid "Return the square root of the argument to full precision."
msgstr "返回参数的平方根精确到完整精度。"
#: ../../library/decimal.rst:861 ../../library/decimal.rst:1437
msgid ""
"Convert to a string, using engineering notation if an exponent is needed."
msgstr "转换为字符串,如果需要指数则会使用工程标注法。"
#: ../../library/decimal.rst:863 ../../library/decimal.rst:1439
msgid ""
"Engineering notation has an exponent which is a multiple of 3. This can "
"leave up to 3 digits to the left of the decimal place and may require the "
"addition of either one or two trailing zeros."
msgstr "工程标注法的指数是 3 的倍数。 这会在十进制位的左边保留至多 3 个数码,并可能要求添加一至两个末尾零。"
#: ../../library/decimal.rst:867
msgid ""
"For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``."
msgstr "例如,此方法会将 ``Decimal('123E+1')`` 转换为 ``Decimal('1.23E+3')``。"
#: ../../library/decimal.rst:871
msgid ""
"Identical to the :meth:`to_integral_value` method. The ``to_integral`` name"
" has been kept for compatibility with older versions."
msgstr "与 :meth:`to_integral_value` 方法相同。 保留 ``to_integral`` 名称是为了与旧版本兼容。"
#: ../../library/decimal.rst:876
msgid ""
"Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded`"
" as appropriate if rounding occurs. The rounding mode is determined by the "
"``rounding`` parameter if given, else by the given ``context``. If neither "
"parameter is given then the rounding mode of the current context is used."
msgstr ""
"舍入到最接近的整数,发出信号 :const:`Inexact` 或者如果发生舍入则相应地发出信号 :const:`Rounded`。 如果给出 "
"``rounding`` 形参则由其确定舍入模式,否则由给定的 ``context`` 来确定。 如果没有给定任何形参则会使用当前上下文的舍入模式。"
#: ../../library/decimal.rst:884
msgid ""