@@ -824,6 +824,8 @@ msgid ""
824
824
"`Decimal` instance as a fraction, in lowest terms and with a positive "
825
825
"denominator::"
826
826
msgstr ""
827
+ "回傳一對表示給定 :class:`Decimal` 實例作為分數的整數 ``(n, d)``,以最簡形式"
828
+ "且分母為正: ::"
827
829
828
830
#: ../../library/decimal.rst:467
829
831
msgid ""
@@ -838,25 +840,32 @@ msgid ""
838
840
"The conversion is exact. Raise OverflowError on infinities and ValueError "
839
841
"on NaNs."
840
842
msgstr ""
843
+ "轉換是精確的。對無窮大引發 OverflowError,對 NaN 引發 ValueError。"
841
844
842
845
#: ../../library/decimal.rst:477
843
846
msgid ""
844
847
"Return a :term:`named tuple` representation of the number: "
845
848
"``DecimalTuple(sign, digits, exponent)``."
846
849
msgstr ""
850
+ "回傳數字的 :term:`named tuple` 表示形式:"
851
+ "``DecimalTuple(sign, digits, exponent)``。"
847
852
848
853
#: ../../library/decimal.rst:483
849
854
msgid ""
850
855
"Return the canonical encoding of the argument. Currently, the encoding of "
851
856
"a :class:`Decimal` instance is always canonical, so this operation returns "
852
857
"its argument unchanged."
853
858
msgstr ""
859
+ "回傳引數的標準編碼。目前,:class:`Decimal` 實例的編碼總是標準的,因此此運算"
860
+ "回傳其引數不變。"
854
861
855
862
#: ../../library/decimal.rst:489
856
863
msgid ""
857
864
"Compare the values of two Decimal instances. :meth:`compare` returns a "
858
865
"Decimal instance, and if either operand is a NaN then the result is a NaN::"
859
866
msgstr ""
867
+ "比較兩個 Decimal 實例的值。:meth:`compare` 回傳一個 Decimal 實例,如果任一"
868
+ "運算元是 NaN,則結果是 NaN: ::"
860
869
861
870
#: ../../library/decimal.rst:493
862
871
msgid ""
@@ -876,6 +885,9 @@ msgid ""
876
885
"NaNs signal. That is, if neither operand is a signaling NaN then any quiet "
877
886
"NaN operand is treated as though it were a signaling NaN."
878
887
msgstr ""
888
+ "此運算與 :meth:`compare` 方法相同,除了所有 NaN 都會發出訊號。也就是說,如果"
889
+ "兩個運算元都不是發出訊號的 NaN,那麼任何安靜的 NaN 運算元都會被視為發出訊號的 "
890
+ "NaN。"
879
891
880
892
#: ../../library/decimal.rst:506
881
893
msgid ""
@@ -885,6 +897,9 @@ msgid ""
885
897
"instances with the same numeric value but different representations compare "
886
898
"unequal in this ordering:"
887
899
msgstr ""
900
+ "使用抽象表示而不是數值來比較兩個運算元。類似於 :meth:`compare` 方法,但結果"
901
+ "對 :class:`Decimal` 實例給出全序。在此排序中,具有相同數值但不同表示的兩個 "
902
+ ":class:`Decimal` 實例比較為不相等:"
888
903
889
904
#: ../../library/decimal.rst:515
890
905
msgid ""
@@ -895,6 +910,10 @@ msgid ""
895
910
"in the total order than the second operand. See the specification for "
896
911
"details of the total order."
897
912
msgstr ""
913
+ "安靜和發出訊號的 NaN 也包含在全序中。如果兩個運算元具有相同的表示,此函式的"
914
+ "結果是 ``Decimal('0')``;如果第一個運算元在全序中低於第二個,則為 "
915
+ "``Decimal('-1')``;如果第一個運算元在全序中高於第二個運算元,則為 "
916
+ "``Decimal('1')``。有關全序的詳細資訊,請參閱規範。"
898
917
899
918
#: ../../library/decimal.rst:522 ../../library/decimal.rst:533
900
919
#: ../../library/decimal.rst:561 ../../library/decimal.rst:848
@@ -903,6 +922,8 @@ msgid ""
903
922
"and no rounding is performed. As an exception, the C version may raise "
904
923
"InvalidOperation if the second operand cannot be converted exactly."
905
924
msgstr ""
925
+ "此運算不受情境影響且是安靜的:不會變更旗標也不會執行捨入。例外情況下,如果"
926
+ "第二個運算元無法精確轉換,C 版本可能會引發 InvalidOperation。"
906
927
907
928
#: ../../library/decimal.rst:528
908
929
msgid ""
@@ -911,43 +932,53 @@ msgid ""
911
932
"``x.compare_total_mag(y)`` is equivalent to ``x.copy_abs().compare_total(y."
912
933
"copy_abs())``."
913
934
msgstr ""
935
+ "如 :meth:`compare_total` 般使用抽象表示而不是值來比較兩個運算元,但忽略每個"
936
+ "運算元的符號。``x.compare_total_mag(y)`` 等於 ``x.copy_abs().compare_total"
937
+ "(y.copy_abs())``。"
914
938
915
939
#: ../../library/decimal.rst:539
916
940
msgid ""
917
941
"Just returns self, this method is only to comply with the Decimal "
918
942
"Specification."
919
943
msgstr ""
944
+ "只是回傳 self,此方法僅為符合 Decimal 規範。"
920
945
921
946
#: ../../library/decimal.rst:544
922
947
msgid ""
923
948
"Return the absolute value of the argument. This operation is unaffected by "
924
949
"the context and is quiet: no flags are changed and no rounding is performed."
925
950
msgstr ""
951
+ "回傳引數的絕對值。此運算不受情境影響且是安靜的:不會變更旗標也不會執行捨入。"
926
952
927
953
#: ../../library/decimal.rst:550
928
954
msgid ""
929
955
"Return the negation of the argument. This operation is unaffected by the "
930
956
"context and is quiet: no flags are changed and no rounding is performed."
931
957
msgstr ""
958
+ "回傳引數的否定。此運算不受情境影響且是安靜的:不會變更旗標也不會執行捨入。"
932
959
933
960
#: ../../library/decimal.rst:555
934
961
msgid ""
935
962
"Return a copy of the first operand with the sign set to be the same as the "
936
963
"sign of the second operand. For example:"
937
964
msgstr ""
965
+ "回傳第一個運算元的副本,其符號被設定為與第二個運算元的符號相同。例如:"
938
966
939
967
#: ../../library/decimal.rst:567
940
968
msgid ""
941
969
"Return the value of the (natural) exponential function ``e**x`` at the given "
942
970
"number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` "
943
971
"rounding mode."
944
972
msgstr ""
973
+ "回傳給定數字的(自然)指數函式 ``e**x`` 的值。使用 :const:`ROUND_HALF_EVEN` "
974
+ "捨入模式正確地捨入結果。"
945
975
946
976
#: ../../library/decimal.rst:578
947
977
msgid ""
948
978
"Alternative constructor that only accepts instances of :class:`float` or :"
949
979
"class:`int`."
950
980
msgstr ""
981
+ "僅接受 :class:`float` 或 :class:`int` 實例的替代建構函式。"
951
982
952
983
#: ../../library/decimal.rst:581
953
984
msgid ""
@@ -957,12 +988,17 @@ msgid ""
957
988
"``0x1.999999999999ap-4``. That equivalent value in decimal is "
958
989
"``0.1000000000000000055511151231257827021181583404541015625``."
959
990
msgstr ""
991
+ "注意 ``Decimal.from_float(0.1)`` 與 ``Decimal('0.1')`` 不同。由於 0.1 在"
992
+ "二進位浮點數中無法精確表示,該值被儲存為最接近的可表示值 "
993
+ "``0x1.999999999999ap-4``。該值在十進位中的等價值是 "
994
+ "``0.1000000000000000055511151231257827021181583404541015625``。"
960
995
961
996
#: ../../library/decimal.rst:587
962
997
msgid ""
963
998
"From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed "
964
999
"directly from a :class:`float`."
965
1000
msgstr ""
1001
+ "從 Python 3.2 開始,:class:`Decimal` 實例也可以直接從 :class:`float` 建構。"
966
1002
967
1003
#: ../../library/decimal.rst:590
968
1004
msgid ""
@@ -989,49 +1025,61 @@ msgid ""
989
1025
"Fused multiply-add. Return self*other+third with no rounding of the "
990
1026
"intermediate product self*other."
991
1027
msgstr ""
1028
+ "融合乘加。回傳 self*other+third,對中間產品 self*other 不進行捨入。"
992
1029
993
1030
#: ../../library/decimal.rst:613
994
1031
msgid ""
995
1032
"Return :const:`True` if the argument is canonical and :const:`False` "
996
1033
"otherwise. Currently, a :class:`Decimal` instance is always canonical, so "
997
1034
"this operation always returns :const:`True`."
998
1035
msgstr ""
1036
+ "如果引數是標準形式則回傳 :const:`True`,否則回傳 :const:`False`。目前,"
1037
+ ":class:`Decimal` 實例總是標準形式,因此此運算總是回傳 :const:`True`。"
999
1038
1000
1039
#: ../../library/decimal.rst:619
1001
1040
msgid ""
1002
1041
"Return :const:`True` if the argument is a finite number, and :const:`False` "
1003
1042
"if the argument is an infinity or a NaN."
1004
1043
msgstr ""
1044
+ "如果引數是有限數則回傳 :const:`True`,如果引數是無窮大或 NaN 則回傳 "
1045
+ ":const:`False`。"
1005
1046
1006
1047
#: ../../library/decimal.rst:624
1007
1048
msgid ""
1008
1049
"Return :const:`True` if the argument is either positive or negative infinity "
1009
1050
"and :const:`False` otherwise."
1010
1051
msgstr ""
1052
+ "如果引數是正無窮大或負無窮大則回傳 :const:`True`,否則回傳 :const:`False`。"
1011
1053
1012
1054
#: ../../library/decimal.rst:629
1013
1055
msgid ""
1014
1056
"Return :const:`True` if the argument is a (quiet or signaling) NaN and :"
1015
1057
"const:`False` otherwise."
1016
1058
msgstr ""
1059
+ "如果引數是(安靜或發出訊號的)NaN 則回傳 :const:`True`,否則回傳 :const:`False`。"
1017
1060
1018
1061
#: ../../library/decimal.rst:634
1019
1062
msgid ""
1020
1063
"Return :const:`True` if the argument is a *normal* finite number. Return :"
1021
1064
"const:`False` if the argument is zero, subnormal, infinite or a NaN."
1022
1065
msgstr ""
1066
+ "如果引數是 *正常* 有限數則回傳 :const:`True`。如果引數是零、次正規、無窮大"
1067
+ "或 NaN 則回傳 :const:`False`。"
1023
1068
1024
1069
#: ../../library/decimal.rst:639
1025
1070
msgid ""
1026
1071
"Return :const:`True` if the argument is a quiet NaN, and :const:`False` "
1027
1072
"otherwise."
1028
1073
msgstr ""
1074
+ "如果引數是安靜 NaN 則回傳 :const:`True`,否則回傳 :const:`False`。"
1029
1075
1030
1076
#: ../../library/decimal.rst:644
1031
1077
msgid ""
1032
1078
"Return :const:`True` if the argument has a negative sign and :const:`False` "
1033
1079
"otherwise. Note that zeros and NaNs can both carry signs."
1034
1080
msgstr ""
1081
+ "如果引數具有負號則回傳 :const:`True`,否則回傳 :const:`False`。注意零和 NaN "
1082
+ "都可以帶有符號。"
1035
1083
1036
1084
#: ../../library/decimal.rst:649
1037
1085
msgid ""
@@ -2125,41 +2173,42 @@ msgstr ""
2125
2173
2126
2174
#: ../../library/decimal.rst:1580
2127
2175
msgid "Rounding modes"
2128
- msgstr ""
2176
+ msgstr "捨入模式 "
2129
2177
2130
2178
#: ../../library/decimal.rst:1584
2131
2179
msgid "Round towards ``Infinity``."
2132
- msgstr ""
2180
+ msgstr "向 ``Infinity`` 捨入。 "
2133
2181
2134
2182
#: ../../library/decimal.rst:1588
2135
2183
msgid "Round towards zero."
2136
- msgstr ""
2184
+ msgstr "向零捨入。 "
2137
2185
2138
2186
#: ../../library/decimal.rst:1592
2139
2187
msgid "Round towards ``-Infinity``."
2140
- msgstr ""
2188
+ msgstr "向 ``-Infinity`` 捨入。 "
2141
2189
2142
2190
#: ../../library/decimal.rst:1596
2143
2191
msgid "Round to nearest with ties going towards zero."
2144
- msgstr ""
2192
+ msgstr "捨入到最近值,平局時向零捨入。 "
2145
2193
2146
2194
#: ../../library/decimal.rst:1600
2147
2195
msgid "Round to nearest with ties going to nearest even integer."
2148
- msgstr ""
2196
+ msgstr "捨入到最近值,平局時向最近的偶數捨入。 "
2149
2197
2150
2198
#: ../../library/decimal.rst:1604
2151
2199
msgid "Round to nearest with ties going away from zero."
2152
- msgstr ""
2200
+ msgstr "捨入到最近值,平局時遠離零捨入。 "
2153
2201
2154
2202
#: ../../library/decimal.rst:1608
2155
2203
msgid "Round away from zero."
2156
- msgstr ""
2204
+ msgstr "遠離零捨入。 "
2157
2205
2158
2206
#: ../../library/decimal.rst:1612
2159
2207
msgid ""
2160
2208
"Round away from zero if last digit after rounding towards zero would have "
2161
2209
"been 0 or 5; otherwise round towards zero."
2162
2210
msgstr ""
2211
+ "如果向零捨入後的最後一位數字為 0 或 5,則遠離零捨入;否則向零捨入。"
2163
2212
2164
2213
#: ../../library/decimal.rst:1619
2165
2214
msgid "Signals"
@@ -2196,50 +2245,57 @@ msgstr ""
2196
2245
2197
2246
#: ../../library/decimal.rst:1637
2198
2247
msgid "Altered an exponent to fit representation constraints."
2199
- msgstr ""
2248
+ msgstr "更改指數以符合表示限制。 "
2200
2249
2201
2250
#: ../../library/decimal.rst:1639
2202
2251
msgid ""
2203
2252
"Typically, clamping occurs when an exponent falls outside the context's :"
2204
2253
"attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the "
2205
2254
"exponent is reduced to fit by adding zeros to the coefficient."
2206
2255
msgstr ""
2256
+ "通常,當指數超出情境的 :attr:`~Context.Emin` 和 :attr:`~Context.Emax` 限制時,"
2257
+ "會發生夾制。如果可能的話,透過在係數中新增零來縮小指數以符合限制。"
2207
2258
2208
2259
#: ../../library/decimal.rst:1646
2209
2260
msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`."
2210
- msgstr ""
2261
+ msgstr "其他訊號的基底類別,也是 :exc:`ArithmeticError` 的子類別。 "
2211
2262
2212
2263
#: ../../library/decimal.rst:1651
2213
2264
msgid "Signals the division of a non-infinite number by zero."
2214
- msgstr ""
2265
+ msgstr "發出非無限數被零除的訊號。 "
2215
2266
2216
2267
#: ../../library/decimal.rst:1653
2217
2268
msgid ""
2218
2269
"Can occur with division, modulo division, or when raising a number to a "
2219
2270
"negative power. If this signal is not trapped, returns ``Infinity`` or ``-"
2220
2271
"Infinity`` with the sign determined by the inputs to the calculation."
2221
2272
msgstr ""
2273
+ "可能發生在除法、模除法或將數字提升到負次方時。如果此訊號未被捕捉,回傳 "
2274
+ "``Infinity`` 或 ``-Infinity``,符號由計算的輸入決定。"
2222
2275
2223
2276
#: ../../library/decimal.rst:1660
2224
2277
msgid "Indicates that rounding occurred and the result is not exact."
2225
- msgstr ""
2278
+ msgstr "指示發生了捨入且結果不精確。 "
2226
2279
2227
2280
#: ../../library/decimal.rst:1662
2228
2281
msgid ""
2229
2282
"Signals when non-zero digits were discarded during rounding. The rounded "
2230
2283
"result is returned. The signal flag or trap is used to detect when results "
2231
2284
"are inexact."
2232
2285
msgstr ""
2286
+ "當捨入過程中丟棄非零數字時發出訊號。回傳捨入結果。訊號旗標或陷阱用於檢測"
2287
+ "結果何時不精確。"
2233
2288
2234
2289
#: ../../library/decimal.rst:1669
2235
2290
msgid "An invalid operation was performed."
2236
- msgstr ""
2291
+ msgstr "執行了無效的運算。 "
2237
2292
2238
2293
#: ../../library/decimal.rst:1671
2239
2294
msgid ""
2240
2295
"Indicates that an operation was requested that does not make sense. If not "
2241
2296
"trapped, returns ``NaN``. Possible causes include::"
2242
2297
msgstr ""
2298
+ "指示請求了不合理的運算。如果未被捕捉,回傳 ``NaN``。可能的原因包括: ::"
2243
2299
2244
2300
#: ../../library/decimal.rst:1674
2245
2301
msgid ""
0 commit comments