@@ -1394,28 +1394,32 @@ msgstr ""
1394
1394
1395
1395
#: ../../library/decimal.rst:962
1396
1396
msgid "Context objects"
1397
- msgstr ""
1397
+ msgstr "Context 物件 "
1398
1398
1399
1399
#: ../../library/decimal.rst:964
1400
1400
msgid ""
1401
1401
"Contexts are environments for arithmetic operations. They govern precision, "
1402
1402
"set rules for rounding, determine which signals are treated as exceptions, "
1403
1403
"and limit the range for exponents."
1404
1404
msgstr ""
1405
+ "Context 是算術運算的環境。它們控制精度、設定捨入規則、決定哪些信號被視為例外,"
1406
+ "並限制指數的範圍。"
1405
1407
1406
1408
#: ../../library/decimal.rst:968
1407
1409
msgid ""
1408
1410
"Each thread has its own current context which is accessed or changed using "
1409
1411
"the :func:`getcontext` and :func:`setcontext` functions:"
1410
1412
msgstr ""
1413
+ "每個執行緒都有自己的目前上下文,可以使用 :func:`getcontext` 和 :func:"
1414
+ "`setcontext` 函式來存取或變更:"
1411
1415
1412
1416
#: ../../library/decimal.rst:974
1413
1417
msgid "Return the current context for the active thread."
1414
- msgstr ""
1418
+ msgstr "回傳作用中執行緒的目前上下文。 "
1415
1419
1416
1420
#: ../../library/decimal.rst:979
1417
1421
msgid "Set the current context for the active thread to *c*."
1418
- msgstr ""
1422
+ msgstr "將作用中執行緒的目前上下文設定為 *c*。 "
1419
1423
1420
1424
#: ../../library/decimal.rst:981
1421
1425
msgid ""
@@ -2030,6 +2034,7 @@ msgid ""
2030
2034
"The constants in this section are only relevant for the C module. They are "
2031
2035
"also included in the pure Python version for compatibility."
2032
2036
msgstr ""
2037
+ "本節中的常數僅與 C 模組相關。為了相容性,它們也包含在純 Python 版本中。"
2033
2038
2034
2039
#: ../../library/decimal.rst:1551
2035
2040
msgid "32-bit"
@@ -2117,13 +2122,15 @@ msgstr ""
2117
2122
2118
2123
#: ../../library/decimal.rst:1619
2119
2124
msgid "Signals"
2120
- msgstr ""
2125
+ msgstr "信號 "
2121
2126
2122
2127
#: ../../library/decimal.rst:1621
2123
2128
msgid ""
2124
2129
"Signals represent conditions that arise during computation. Each corresponds "
2125
2130
"to one context flag and one context trap enabler."
2126
2131
msgstr ""
2132
+ "信號代表在計算過程中產生的條件。每個信號對應一個上下文旗標和一個上下文陷阱"
2133
+ "啟用器。"
2127
2134
2128
2135
#: ../../library/decimal.rst:1624
2129
2136
msgid ""
@@ -2132,6 +2139,8 @@ msgid ""
2132
2139
"to determine whether a computation was exact). After checking the flags, be "
2133
2140
"sure to clear all flags before starting the next computation."
2134
2141
msgstr ""
2142
+ "每當遇到條件時,上下文旗標就會被設定。計算後,可以檢查旗標以獲取資訊(例如,"
2143
+ "確定計算是否精確)。檢查旗標後,請確保在開始下一次計算之前清除所有旗標。"
2135
2144
2136
2145
#: ../../library/decimal.rst:1629
2137
2146
msgid ""
@@ -2140,6 +2149,9 @@ msgid ""
2140
2149
"`DivisionByZero` trap is set, then a :exc:`DivisionByZero` exception is "
2141
2150
"raised upon encountering the condition."
2142
2151
msgstr ""
2152
+ "如果為信號設定了上下文的陷阱啟用器,那麼條件會導致引發 Python 例外。例如,"
2153
+ "如果設定了 :class:`DivisionByZero` 陷阱,那麼在遇到條件時會引發 :exc:"
2154
+ "`DivisionByZero` 例外。"
2143
2155
2144
2156
#: ../../library/decimal.rst:1637
2145
2157
msgid "Altered an exponent to fit representation constraints."
@@ -2308,11 +2320,11 @@ msgstr ""
2308
2320
2309
2321
#: ../../library/decimal.rst:1759
2310
2322
msgid "Floating-point notes"
2311
- msgstr ""
2323
+ msgstr "浮點數注意事項 "
2312
2324
2313
2325
#: ../../library/decimal.rst:1763
2314
2326
msgid "Mitigating round-off error with increased precision"
2315
- msgstr ""
2327
+ msgstr "透過增加精度來減輕捨入誤差 "
2316
2328
2317
2329
#: ../../library/decimal.rst:1765
2318
2330
msgid ""
@@ -2321,6 +2333,8 @@ msgid ""
2321
2333
"can still incur round-off error when non-zero digits exceed the fixed "
2322
2334
"precision."
2323
2335
msgstr ""
2336
+ "使用十進位浮點數消除了十進位表示誤差(使得可以精確表示 ``0.1``);然而,當"
2337
+ "非零數字超過固定精度時,某些運算仍然可能產生捨入誤差。"
2324
2338
2325
2339
#: ../../library/decimal.rst:1769
2326
2340
msgid ""
@@ -2453,7 +2467,7 @@ msgstr ""
2453
2467
2454
2468
#: ../../library/decimal.rst:1873
2455
2469
msgid "Working with threads"
2456
- msgstr ""
2470
+ msgstr "與執行緒協作 "
2457
2471
2458
2472
#: ../../library/decimal.rst:1875
2459
2473
msgid ""
@@ -2462,19 +2476,25 @@ msgid ""
2462
2476
"make changes (such as ``getcontext().prec=10``) without interfering with "
2463
2477
"other threads."
2464
2478
msgstr ""
2479
+ ":func:`getcontext` 函式為每個執行緒存取不同的 :class:`Context` 物件。擁有獨立"
2480
+ "的執行緒上下文意味著執行緒可以進行變更(如 ``getcontext().prec=10``)而不會"
2481
+ "干擾其他執行緒。"
2465
2482
2466
2483
#: ../../library/decimal.rst:1879
2467
2484
msgid ""
2468
2485
"Likewise, the :func:`setcontext` function automatically assigns its target "
2469
2486
"to the current thread."
2470
2487
msgstr ""
2488
+ "同樣地,:func:`setcontext` 函式會自動將其目標指派給目前執行緒。"
2471
2489
2472
2490
#: ../../library/decimal.rst:1882
2473
2491
msgid ""
2474
2492
"If :func:`setcontext` has not been called before :func:`getcontext`, then :"
2475
2493
"func:`getcontext` will automatically create a new context for use in the "
2476
2494
"current thread."
2477
2495
msgstr ""
2496
+ "如果在 :func:`getcontext` 之前沒有呼叫 :func:`setcontext`,那麼 :func:"
2497
+ "`getcontext` 會自動建立一個新的上下文供目前執行緒使用。"
2478
2498
2479
2499
#: ../../library/decimal.rst:1886
2480
2500
msgid ""
@@ -2503,13 +2523,14 @@ msgstr ""
2503
2523
2504
2524
#: ../../library/decimal.rst:1911
2505
2525
msgid "Recipes"
2506
- msgstr ""
2526
+ msgstr "實用範例 "
2507
2527
2508
2528
#: ../../library/decimal.rst:1913
2509
2529
msgid ""
2510
2530
"Here are a few recipes that serve as utility functions and that demonstrate "
2511
2531
"ways to work with the :class:`Decimal` class::"
2512
2532
msgstr ""
2533
+ "以下是一些實用範例,作為工具函式並展示與 :class:`Decimal` 類別協作的方法::"
2513
2534
2514
2535
#: ../../library/decimal.rst:1916
2515
2536
msgid ""
@@ -2662,7 +2683,7 @@ msgstr ""
2662
2683
2663
2684
#: ../../library/decimal.rst:2068
2664
2685
msgid "Decimal FAQ"
2665
- msgstr ""
2686
+ msgstr "Decimal 常見問題 "
2666
2687
2667
2688
#: ../../library/decimal.rst:2070
2668
2689
msgid ""
0 commit comments