From 338331f69da3d8c1b004362ab9ef7ce51fd8b6d4 Mon Sep 17 00:00:00 2001 From: Enkai Date: Mon, 11 Mar 2024 21:19:57 +0800 Subject: [PATCH 1/4] Translate cmath --- library/cmath.po | 120 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 30 deletions(-) diff --git a/library/cmath.po b/library/cmath.po index f85f0d8f4d..4aa27a9c75 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" -"PO-Revision-Date: 2018-05-23 14:40+0000\n" +"PO-Revision-Date: 2024-03-11 20:33+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.4.2\n" #: ../../library/cmath.rst:2 msgid ":mod:`cmath` --- Mathematical functions for complex numbers" -msgstr "" +msgstr ":mod:`cmath` --- 複數的數學函式" #: ../../library/cmath.rst:9 msgid "" @@ -32,6 +33,10 @@ msgid "" "floating-point number, respectively, and the function is then applied to the " "result of the conversion." msgstr "" +"本模組提供一些適用於複數的數學函式。本模組中的函式接受整數、浮點數或複數作為" +"引數。它們也接受任何具有 :meth:`~object.__complex__` 或 :meth:`~object." +"__float__` 方法的 Python 物件:這些方法分別用於將物件轉換為複數或浮點數,然後" +"再將函式應用於轉換後的結果。" #: ../../library/cmath.rst:18 msgid "" @@ -43,6 +48,11 @@ msgid "" "axis we look at the sign of the imaginary part, while for a branch cut along " "the imaginary axis we look at the sign of the real part." msgstr "" +"對於涉及分枝切割 (branch cut) 的函式,我們面臨的問題是決定如何定義在切割本身" +"上的這些函式。遵循 Kahan 的論文 \"Branch cuts for complex elementary " +"functions\" ,以及 C99 的附錄 G 和後來的 C 標準,我們使用零符號來區分分枝切割" +"的兩側:對於沿著(一部分)實數軸的分枝切割,我們查看虛部的符號,而對於沿虛軸" +"的分枝切割,我們則查看實部的符號。" #: ../../library/cmath.rst:26 msgid "" @@ -51,16 +61,19 @@ msgid "" "though it lies *below* the branch cut, and so gives a result on the negative " "imaginary axis::" msgstr "" +"例如 :func:`cmath.sqrt` 函式具有一條沿負實軸的分枝切割。 引數 " +"``complex(-2.0, -0.0)`` 被視為位於分枝切割 *下方* 處理,因此給出的結果在負虛" +"軸上: ::" #: ../../library/cmath.rst:34 msgid "" "But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " "the branch cut::" -msgstr "" +msgstr "但是引數 ``complex(-2.0, 0.0)`` 會被當成位於分枝切割上方處理: ::" #: ../../library/cmath.rst:42 msgid "Conversions to and from polar coordinates" -msgstr "" +msgstr "轉換到極座標和從極座標做轉換" #: ../../library/cmath.rst:44 msgid "" @@ -68,6 +81,8 @@ msgid "" "*Cartesian* coordinates. It is completely determined by its *real part* ``z." "real`` and its *imaginary part* ``z.imag``. In other words::" msgstr "" +"Python 複數 ``z`` 是用 *直角坐標* 或 *笛卡爾坐標* 儲存在內部的。它完全是由其 " +"*實部* ``z.real``和 *虛部* ``z.imag`` 所決定。換句話說: ::" #: ../../library/cmath.rst:51 msgid "" @@ -78,12 +93,15 @@ msgid "" "radians, from the positive x-axis to the line segment that joins the origin " "to *z*." msgstr "" +"*極座標* 提供了另一種表示複數的方法。在極座標中,複數 *z* 由絕對值 (modulus) " +"*r* 和相位角 (phase) *phi* 定義。絕對值 *r* 是從 *z* 到原點的距離,而相位角 " +"*phi* 是從正 x 軸到連接原點到 *z* 的線段的逆時針角度(以弧度為單位)。" #: ../../library/cmath.rst:58 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." -msgstr "" +msgstr "以下的函式可用於原始直角座標與極座標之間的相互轉換。" #: ../../library/cmath.rst:63 msgid "" @@ -93,6 +111,10 @@ msgid "" "along the negative real axis. The sign of the result is the same as the " "sign of ``x.imag``, even when ``x.imag`` is zero::" msgstr "" +"以浮點數的形式回傳 *x* 的相位角(也稱為 *x* 的 *引數* )。 ``phase(x)`` 等價" +"於 ``math.atan2(x.imag, x.real)`` 。結果將位於 [-\\ *π*, *π*] 的範圍內,且此" +"操作的分枝切割將位於負實軸上。結果的符號會與 ``x.imag`` 的符號相同,即使 ``x." +"imag`` 為零: ::" #: ../../library/cmath.rst:77 msgid "" @@ -100,6 +122,8 @@ msgid "" "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " "function for this operation." msgstr "" +"複數 *x* 的絕對值可以使用內建的 :func:`abs` 函式計算。沒有單獨的 :mod:" +"`cmath` 模組函式適用於此操作。" #: ../../library/cmath.rst:84 msgid "" @@ -107,22 +131,26 @@ msgid "" "phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " "``polar(x)`` is equivalent to ``(abs(x), phase(x))``." msgstr "" +"回傳 *x* 在極座標中的表達方式。回傳一組數對 ``(r, phi)`` , *r* 是 *x* 的絕對" +"值, *phi* 是 *x* 的相位角。 ``polar(x)`` 相當於 ``(abs(x), phase(x))`` 。" #: ../../library/cmath.rst:92 msgid "" "Return the complex number *x* with polar coordinates *r* and *phi*. " "Equivalent to ``r * (math.cos(phi) + math.sin(phi)*1j)``." msgstr "" +"透過極座標 *r* 和 *phi* 回傳複數 *x* 。相當於 ``r * (math.cos(phi) + math." +"sin(phi)*1j)`` 。" #: ../../library/cmath.rst:97 msgid "Power and logarithmic functions" -msgstr "" +msgstr "冪函數和對數函數" #: ../../library/cmath.rst:101 msgid "" "Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." -msgstr "" +msgstr "回傳 *e* 的 *x* 次方,其中 *e* 是自然對數的底數。" #: ../../library/cmath.rst:107 msgid "" @@ -130,21 +158,23 @@ msgid "" "specified, returns the natural logarithm of *x*. There is one branch cut, " "from 0 along the negative real axis to -∞." msgstr "" +"回傳 *x* 給定 *base* 的對數。如果未指定 *base* ,則傳回 *x* 的自然對數。存在" +"一條分枝切割,從 0 沿負實數軸到 -∞ 。" #: ../../library/cmath.rst:114 msgid "" "Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." -msgstr "" +msgstr "回傳 *x* 以 10 為底的對數。它與 :func:`log` 具有相同的分枝切割。" #: ../../library/cmath.rst:120 msgid "" "Return the square root of *x*. This has the same branch cut as :func:`log`." -msgstr "" +msgstr "回傳 *x* 的平方根。它與 :func:`log` 具有相同的分枝切割。" #: ../../library/cmath.rst:124 msgid "Trigonometric functions" -msgstr "" +msgstr "三角函數" #: ../../library/cmath.rst:128 msgid "" @@ -152,11 +182,13 @@ msgid "" "from 1 along the real axis to ∞. The other extends left from -1 along the " "real axis to -∞." msgstr "" +"回傳 *x* 的反餘弦值。存在兩條分枝切割:一條是從 1 沿著實數軸向右延伸到 ∞。另" +"一條從 -1 沿實數軸向左延伸到 -∞。" #: ../../library/cmath.rst:135 msgid "" "Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." -msgstr "" +msgstr "回傳 *x* 的反正弦值。它與 :func:`acos` 具有相同的分枝切割。" #: ../../library/cmath.rst:140 msgid "" @@ -164,28 +196,31 @@ msgid "" "``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " "along the imaginary axis to ``-∞j``." msgstr "" +"回傳 *x* 的反正切值。有兩條分枝切割:一條是從 ``1j`` 沿著虛軸延伸到 ``∞j`` 。" +"另一條從 ``-1j`` 沿著虛軸延伸到 ``-∞j`` 。" #: ../../library/cmath.rst:147 msgid "Return the cosine of *x*." -msgstr "" +msgstr "回傳 *x* 的餘弦值。" #: ../../library/cmath.rst:152 msgid "Return the sine of *x*." -msgstr "" +msgstr "回傳 *x* 的正弦值。" #: ../../library/cmath.rst:157 msgid "Return the tangent of *x*." -msgstr "" +msgstr "回傳 *x* 的正切值。" #: ../../library/cmath.rst:161 msgid "Hyperbolic functions" -msgstr "" +msgstr "雙曲函數" #: ../../library/cmath.rst:165 msgid "" "Return the inverse hyperbolic cosine of *x*. There is one branch cut, " "extending left from 1 along the real axis to -∞." msgstr "" +"回傳 *x* 的反雙曲餘弦值。存在一條分枝切割,從 1 沿實數軸向左延伸到 -∞。" #: ../../library/cmath.rst:171 msgid "" @@ -193,6 +228,8 @@ msgid "" "extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " "from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" +"回傳 *x* 的反雙曲正弦值。存在兩條分枝切割:一條是從 ``1j`` 沿著虛軸延伸到 " +"``∞j`` 。另一條從 ``-1j`` 沿著虛軸延伸到 ``-∞j`` 。" #: ../../library/cmath.rst:178 msgid "" @@ -200,52 +237,56 @@ msgid "" "extends from ``1`` along the real axis to ``∞``. The other extends from " "``-1`` along the real axis to ``-∞``." msgstr "" +"回傳 *x* 的反雙曲正切值。存在兩條分枝切割:一條是從 ``1`` 沿著實數軸延伸到 " +"``∞`` 。另一條從 ``-1`` 沿著實數軸延伸到 ``-∞`` 。" #: ../../library/cmath.rst:185 msgid "Return the hyperbolic cosine of *x*." -msgstr "" +msgstr "回傳 *x* 的反雙曲餘弦值。" #: ../../library/cmath.rst:190 msgid "Return the hyperbolic sine of *x*." -msgstr "" +msgstr "回傳 *x* 的反雙曲正弦值。" #: ../../library/cmath.rst:195 msgid "Return the hyperbolic tangent of *x*." -msgstr "" +msgstr "回傳 *x* 的反雙曲正切值。" #: ../../library/cmath.rst:199 msgid "Classification functions" -msgstr "" +msgstr "分類函式" #: ../../library/cmath.rst:203 msgid "" "Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." msgstr "" +"如果 *x* 的實部和虛部都是有限的,則回傳 ``True`` ,否則回傳 ``False`` 。" #: ../../library/cmath.rst:211 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." -msgstr "" +msgstr "如果 *x* 的實部或虛部是無窮大,則回傳 ``True`` ,否則回傳 ``False`` 。" #: ../../library/cmath.rst:217 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." -msgstr "" +msgstr "如果 *x* 的實部或虛部為 NaN,則回傳 ``True`` ,否則回傳 ``False`` 。" #: ../../library/cmath.rst:223 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." -msgstr "" +msgstr "如果 *a* 和 *b* 的值相互接近,則回傳 ``True`` ,否則回傳 ``False`` 。" #: ../../library/cmath.rst:226 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." msgstr "" +"兩個值是否被認為相互接近是由給定的絕對和相對容許偏差 (tolerance) 所決定的。" #: ../../library/cmath.rst:229 msgid "" @@ -255,18 +296,26 @@ msgid "" "tolerance is ``1e-09``, which assures that the two values are the same " "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" +"*rel_tol* 是相對容許偏差 -- 它是 *a* 和 *b* 之間的最大容許偏差值,相對於 *a* " +"或 *b* 的較大絕對值。例如,要設定 5% 的容許偏差,請傳遞 ``rel_tol=0.05`` 。預" +"設容許偏差是 ``1e-09`` ,它確保兩個值在大約 9 位十進制數字內相同。 *rel_tol* " +"必須大於零。" #: ../../library/cmath.rst:235 msgid "" "*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " "zero. *abs_tol* must be at least zero." msgstr "" +"*abs_tol* 是最小絕對容許偏差 -- 對於接近零的比較很有用。 *abs_tol* 必須至少為" +"零。" #: ../../library/cmath.rst:238 msgid "" "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." msgstr "" +"如果未發生錯誤,結果將為: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), " +"abs_tol)`` 。" #: ../../library/cmath.rst:241 msgid "" @@ -275,10 +324,13 @@ msgid "" "close to any other value, including ``NaN``. ``inf`` and ``-inf`` are only " "considered close to themselves." msgstr "" +"IEEE 754 特殊值 ``NaN`` 、 ``inf`` 和 ``-inf`` 將會根據 IEEE 規則進行處理。具" +"體來說, ``NaN`` 不被認為接近任何其他值,包括 ``NaN`` 。 ``inf`` 和 ``-inf`` " +"只被認為是接近它們自己的。" #: ../../library/cmath.rst:250 msgid ":pep:`485` -- A function for testing approximate equality" -msgstr "" +msgstr ":pep:`485` -- 一個用來測試近似相等的函式" #: ../../library/cmath.rst:254 msgid "Constants" @@ -286,37 +338,37 @@ msgstr "常數" #: ../../library/cmath.rst:258 msgid "The mathematical constant *π*, as a float." -msgstr "" +msgstr "數學常數 *π* ,作為一個浮點數。" #: ../../library/cmath.rst:263 msgid "The mathematical constant *e*, as a float." -msgstr "" +msgstr "數學常數 *e* ,作為一個浮點數。" #: ../../library/cmath.rst:268 msgid "The mathematical constant *τ*, as a float." -msgstr "" +msgstr "數學常數 *τ* ,作為一個浮點數。" #: ../../library/cmath.rst:275 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." -msgstr "" +msgstr "正無窮大的浮點數。相當於 ``float('inf')`` 。" #: ../../library/cmath.rst:282 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." -msgstr "" +msgstr "零為實部和正無窮為虛部的複數。相當於 ``complex(0.0, float('inf'))`` 。" #: ../../library/cmath.rst:290 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." -msgstr "" +msgstr "浮點\\\"非數字\\\" (NaN) 值。相當於 ``float('nan')`` 。" #: ../../library/cmath.rst:298 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." -msgstr "" +msgstr "零為實部和 NaN 為虛部的複數。相當於 ``complex(0.0, float('nan'))`` 。" #: ../../library/cmath.rst:306 msgid "" @@ -329,6 +381,10 @@ msgid "" "as a real number (in which case the complex number has an imaginary part of " "zero)." msgstr "" +"請注意,函式的選擇與模組 :mod:`math` 的類似,但並不完全相同。擁有兩個模組的原" +"因是有些用戶對複數不感興趣,甚至根本就不知道它們是什麼。他們寧願讓 ``math." +"sqrt(-1)`` 引發異常,也不願它回傳複數。另請注意, :mod:`cmath` 中所定義的函式" +"始終都會回傳複數,即使答案可以表示為實數(在這種情況下,複數的虛部為零)。" #: ../../library/cmath.rst:314 msgid "" @@ -340,6 +396,10 @@ msgid "" "choice of branch cuts for numerical purposes, a good reference should be the " "following:" msgstr "" +"關於分枝切割的註釋:它們是沿著給定的不連續函式的曲線。它們是許多複變函數的必" +"要特徵。假設您需要使用複變函數進行計算,您將會了解分枝切割的概念。請參閱幾乎" +"所有關於複變函數的(不是太初級的)書籍以獲得啟發。對於如何正確地基於數值目的" +"選擇分枝切割的相關訊息,以下內容應該是一個很好的參考:" #: ../../library/cmath.rst:324 msgid "" From 28e624d720cfe1039ef6126a7fcc2ed68cf5b685 Mon Sep 17 00:00:00 2001 From: Enkai Huang Date: Mon, 11 Mar 2024 13:28:08 +0000 Subject: [PATCH 2/4] fix typo --- library/cmath.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cmath.po b/library/cmath.po index 4aa27a9c75..5a084a0d8a 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" "PO-Revision-Date: 2024-03-11 20:33+0800\n" -"Last-Translator: Adrian Liaw \n" +"Last-Translator: Enkai Huang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -82,7 +82,7 @@ msgid "" "real`` and its *imaginary part* ``z.imag``. In other words::" msgstr "" "Python 複數 ``z`` 是用 *直角坐標* 或 *笛卡爾坐標* 儲存在內部的。它完全是由其 " -"*實部* ``z.real``和 *虛部* ``z.imag`` 所決定。換句話說: ::" +"*實部* ``z.real`` 和 *虛部* ``z.imag`` 所決定。換句話說: ::" #: ../../library/cmath.rst:51 msgid "" From f98f1dc04429ab1463dd214cb63b1d7c6c917e38 Mon Sep 17 00:00:00 2001 From: Enkai Date: Thu, 14 Mar 2024 10:24:28 +0800 Subject: [PATCH 3/4] update cmath --- library/cmath.po | 121 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 31 deletions(-) diff --git a/library/cmath.po b/library/cmath.po index f85f0d8f4d..219d52293f 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" -"PO-Revision-Date: 2018-05-23 14:40+0000\n" +"PO-Revision-Date: 2024-03-14 09:26+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.4.2\n" #: ../../library/cmath.rst:2 msgid ":mod:`cmath` --- Mathematical functions for complex numbers" -msgstr "" +msgstr ":mod:`cmath` --- 複數的數學函式" #: ../../library/cmath.rst:9 msgid "" @@ -32,6 +33,10 @@ msgid "" "floating-point number, respectively, and the function is then applied to the " "result of the conversion." msgstr "" +"本模組提供一些適用於複數的數學函式。本模組中的函式接受整數、浮點數或複數作為" +"引數。它們也接受任何具有 :meth:`~object.__complex__` 或 :meth:`~object." +"__float__` 方法的 Python 物件:這些方法分別用於將物件轉換為複數或浮點數,然後" +"再將函式應用於轉換後的結果。" #: ../../library/cmath.rst:18 msgid "" @@ -43,6 +48,11 @@ msgid "" "axis we look at the sign of the imaginary part, while for a branch cut along " "the imaginary axis we look at the sign of the real part." msgstr "" +"對於涉及分枝切割 (branch cut) 的函式,我們面臨的問題是決定如何定義在切割本身" +"上的這些函式。遵循 Kahan 的論文 \"Branch cuts for complex elementary " +"functions\",以及 C99 的附錄 G 和後來的 C 標準,我們使用零符號來區分分枝切割" +"的兩側:對於沿著(一部分)實數軸的分枝切割,我們查看虛部的符號,而對於沿虛軸" +"的分枝切割,我們則查看實部的符號。" #: ../../library/cmath.rst:26 msgid "" @@ -51,16 +61,19 @@ msgid "" "though it lies *below* the branch cut, and so gives a result on the negative " "imaginary axis::" msgstr "" +"例如 :func:`cmath.sqrt` 函式具有一條沿負實軸的分枝切割。 引數 " +"``complex(-2.0, -0.0)`` 被視為位於分枝切割 *下方* 處理,因此給出的結果在負虛" +"軸上: ::" #: ../../library/cmath.rst:34 msgid "" "But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " "the branch cut::" -msgstr "" +msgstr "但是引數 ``complex(-2.0, 0.0)`` 會被當成位於分枝切割上方處理: ::" #: ../../library/cmath.rst:42 msgid "Conversions to and from polar coordinates" -msgstr "" +msgstr "轉換到極座標和從極座標做轉換" #: ../../library/cmath.rst:44 msgid "" @@ -68,6 +81,8 @@ msgid "" "*Cartesian* coordinates. It is completely determined by its *real part* ``z." "real`` and its *imaginary part* ``z.imag``. In other words::" msgstr "" +"Python 複數 ``z`` 是用 *直角坐標* 或 *笛卡爾坐標* 儲存在內部的。它完全是由其 " +"*實部* ``z.real`` 和 *虛部* ``z.imag`` 所決定。換句話說: ::" #: ../../library/cmath.rst:51 msgid "" @@ -78,12 +93,15 @@ msgid "" "radians, from the positive x-axis to the line segment that joins the origin " "to *z*." msgstr "" +"*極座標* 提供了另一種表示複數的方法。在極座標中,複數 *z* 由絕對值 (modulus) " +"*r* 和相位角 (phase) *phi* 定義。絕對值 *r* 是從 *z* 到原點的距離,而相位角 " +"*phi* 是從正 x 軸到連接原點到 *z* 的線段的逆時針角度(以弧度為單位)。" #: ../../library/cmath.rst:58 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." -msgstr "" +msgstr "以下的函式可用於原始直角座標與極座標之間的相互轉換。" #: ../../library/cmath.rst:63 msgid "" @@ -93,6 +111,10 @@ msgid "" "along the negative real axis. The sign of the result is the same as the " "sign of ``x.imag``, even when ``x.imag`` is zero::" msgstr "" +"以浮點數的形式回傳 *x* 的相位角(也稱為 *x* 的 *引數* )。 ``phase(x)`` 等價" +"於 ``math.atan2(x.imag, x.real)``。結果將位於 [-\\ *π*, *π*] 的範圍內,且此操" +"作的分枝切割將位於負實軸上。結果的符號會與 ``x.imag`` 的符號相同,即使 ``x." +"imag`` 為零: ::" #: ../../library/cmath.rst:77 msgid "" @@ -100,6 +122,8 @@ msgid "" "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " "function for this operation." msgstr "" +"複數 *x* 的絕對值可以使用內建的 :func:`abs` 函式計算。沒有單獨的 :mod:" +"`cmath` 模組函式適用於此操作。" #: ../../library/cmath.rst:84 msgid "" @@ -107,22 +131,26 @@ msgid "" "phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " "``polar(x)`` is equivalent to ``(abs(x), phase(x))``." msgstr "" +"回傳 *x* 在極座標中的表達方式。回傳一組數對 ``(r, phi)``, *r* 是 *x* 的絕對" +"值, *phi* 是 *x* 的相位角。 ``polar(x)`` 相當於 ``(abs(x), phase(x))``。" #: ../../library/cmath.rst:92 msgid "" "Return the complex number *x* with polar coordinates *r* and *phi*. " "Equivalent to ``r * (math.cos(phi) + math.sin(phi)*1j)``." msgstr "" +"透過極座標 *r* 和 *phi* 回傳複數 *x*。相當於 ``r * (math.cos(phi) + math." +"sin(phi)*1j)``。" #: ../../library/cmath.rst:97 msgid "Power and logarithmic functions" -msgstr "" +msgstr "冪函數和對數函數" #: ../../library/cmath.rst:101 msgid "" "Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." -msgstr "" +msgstr "回傳 *e* 的 *x* 次方,其中 *e* 是自然對數的底數。" #: ../../library/cmath.rst:107 msgid "" @@ -130,21 +158,23 @@ msgid "" "specified, returns the natural logarithm of *x*. There is one branch cut, " "from 0 along the negative real axis to -∞." msgstr "" +"回傳 *x* 給定 *base* 的對數。如果未指定 *base* ,則傳回 *x* 的自然對數。存在" +"一條分枝切割,從 0 沿負實數軸到 -∞。" #: ../../library/cmath.rst:114 msgid "" "Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." -msgstr "" +msgstr "回傳 *x* 以 10 為底的對數。它與 :func:`log` 具有相同的分枝切割。" #: ../../library/cmath.rst:120 msgid "" "Return the square root of *x*. This has the same branch cut as :func:`log`." -msgstr "" +msgstr "回傳 *x* 的平方根。它與 :func:`log` 具有相同的分枝切割。" #: ../../library/cmath.rst:124 msgid "Trigonometric functions" -msgstr "" +msgstr "三角函數" #: ../../library/cmath.rst:128 msgid "" @@ -152,11 +182,13 @@ msgid "" "from 1 along the real axis to ∞. The other extends left from -1 along the " "real axis to -∞." msgstr "" +"回傳 *x* 的反餘弦值。存在兩條分枝切割:一條是從 1 沿著實數軸向右延伸到 ∞。另" +"一條從 -1 沿實數軸向左延伸到 -∞。" #: ../../library/cmath.rst:135 msgid "" "Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." -msgstr "" +msgstr "回傳 *x* 的反正弦值。它與 :func:`acos` 具有相同的分枝切割。" #: ../../library/cmath.rst:140 msgid "" @@ -164,28 +196,31 @@ msgid "" "``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " "along the imaginary axis to ``-∞j``." msgstr "" +"回傳 *x* 的反正切值。有兩條分枝切割:一條是從 ``1j`` 沿著虛軸延伸到 ``∞j``。" +"另一條從 ``-1j`` 沿著虛軸延伸到 ``-∞j``。" #: ../../library/cmath.rst:147 msgid "Return the cosine of *x*." -msgstr "" +msgstr "回傳 *x* 的餘弦值。" #: ../../library/cmath.rst:152 msgid "Return the sine of *x*." -msgstr "" +msgstr "回傳 *x* 的正弦值。" #: ../../library/cmath.rst:157 msgid "Return the tangent of *x*." -msgstr "" +msgstr "回傳 *x* 的正切值。" #: ../../library/cmath.rst:161 msgid "Hyperbolic functions" -msgstr "" +msgstr "雙曲函數" #: ../../library/cmath.rst:165 msgid "" "Return the inverse hyperbolic cosine of *x*. There is one branch cut, " "extending left from 1 along the real axis to -∞." msgstr "" +"回傳 *x* 的反雙曲餘弦值。存在一條分枝切割,從 1 沿實數軸向左延伸到 -∞。" #: ../../library/cmath.rst:171 msgid "" @@ -193,6 +228,8 @@ msgid "" "extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " "from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" +"回傳 *x* 的反雙曲正弦值。存在兩條分枝切割:一條是從 ``1j`` 沿著虛軸延伸到 " +"``∞j``。另一條從 ``-1j`` 沿著虛軸延伸到 ``-∞j``。" #: ../../library/cmath.rst:178 msgid "" @@ -200,52 +237,55 @@ msgid "" "extends from ``1`` along the real axis to ``∞``. The other extends from " "``-1`` along the real axis to ``-∞``." msgstr "" +"回傳 *x* 的反雙曲正切值。存在兩條分枝切割:一條是從 ``1`` 沿著實數軸延伸到 " +"``∞``。另一條從 ``-1`` 沿著實數軸延伸到 ``-∞``。" #: ../../library/cmath.rst:185 msgid "Return the hyperbolic cosine of *x*." -msgstr "" +msgstr "回傳 *x* 的反雙曲餘弦值。" #: ../../library/cmath.rst:190 msgid "Return the hyperbolic sine of *x*." -msgstr "" +msgstr "回傳 *x* 的反雙曲正弦值。" #: ../../library/cmath.rst:195 msgid "Return the hyperbolic tangent of *x*." -msgstr "" +msgstr "回傳 *x* 的反雙曲正切值。" #: ../../library/cmath.rst:199 msgid "Classification functions" -msgstr "" +msgstr "分類函式" #: ../../library/cmath.rst:203 msgid "" "Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." -msgstr "" +msgstr "如果 *x* 的實部和虛部都是有限的,則回傳 ``True``,否則回傳 ``False``。" #: ../../library/cmath.rst:211 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." -msgstr "" +msgstr "如果 *x* 的實部或虛部是無窮大,則回傳 ``True``,否則回傳 ``False``。" #: ../../library/cmath.rst:217 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." -msgstr "" +msgstr "如果 *x* 的實部或虛部為 NaN,則回傳 ``True``,否則回傳 ``False``。" #: ../../library/cmath.rst:223 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." -msgstr "" +msgstr "如果 *a* 和 *b* 的值相互接近,則回傳 ``True``,否則回傳 ``False``。" #: ../../library/cmath.rst:226 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." msgstr "" +"兩個值是否被認為相互接近是由給定的絕對和相對容許偏差 (tolerance) 所決定的。" #: ../../library/cmath.rst:229 msgid "" @@ -255,18 +295,26 @@ msgid "" "tolerance is ``1e-09``, which assures that the two values are the same " "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" +"*rel_tol* 是相對容許偏差 -- 它是 *a* 和 *b* 之間的最大容許偏差值,相對於 *a* " +"或 *b* 的較大絕對值。例如,要設定 5% 的容許偏差,請傳遞 ``rel_tol=0.05``。預" +"設容許偏差是 ``1e-09``,它確保兩個值在大約 9 位十進制數字內相同。 *rel_tol* " +"必須大於零。" #: ../../library/cmath.rst:235 msgid "" "*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " "zero. *abs_tol* must be at least zero." msgstr "" +"*abs_tol* 是最小絕對容許偏差 -- 對於接近零的比較很有用。 *abs_tol* 必須至少為" +"零。" #: ../../library/cmath.rst:238 msgid "" "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." msgstr "" +"如果未發生錯誤,結果將為: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), " +"abs_tol)``。" #: ../../library/cmath.rst:241 msgid "" @@ -275,10 +323,13 @@ msgid "" "close to any other value, including ``NaN``. ``inf`` and ``-inf`` are only " "considered close to themselves." msgstr "" +"IEEE 754 特殊值 ``NaN`` 、 ``inf`` 和 ``-inf`` 將會根據 IEEE 規則進行處理。具" +"體來說, ``NaN`` 不被認為接近任何其他值,包括 ``NaN``。 ``inf`` 和 ``-inf`` " +"只被認為是接近它們自己的。" #: ../../library/cmath.rst:250 msgid ":pep:`485` -- A function for testing approximate equality" -msgstr "" +msgstr ":pep:`485` -- 一個用來測試近似相等的函式" #: ../../library/cmath.rst:254 msgid "Constants" @@ -286,37 +337,37 @@ msgstr "常數" #: ../../library/cmath.rst:258 msgid "The mathematical constant *π*, as a float." -msgstr "" +msgstr "數學常數 *π*,作為一個浮點數。" #: ../../library/cmath.rst:263 msgid "The mathematical constant *e*, as a float." -msgstr "" +msgstr "數學常數 *e*,作為一個浮點數。" #: ../../library/cmath.rst:268 msgid "The mathematical constant *τ*, as a float." -msgstr "" +msgstr "數學常數 *τ*,作為一個浮點數。" #: ../../library/cmath.rst:275 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." -msgstr "" +msgstr "正無窮大的浮點數。相當於 ``float('inf')``。" #: ../../library/cmath.rst:282 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." -msgstr "" +msgstr "實部為零和虛部為正無窮的複數。相當於 ``complex(0.0, float('inf'))``。" #: ../../library/cmath.rst:290 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." -msgstr "" +msgstr "浮點「非數字」 (NaN) 值。相當於 ``float('nan')``。" #: ../../library/cmath.rst:298 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." -msgstr "" +msgstr "實部為零和虛部為 NaN 的複數。相當於 ``complex(0.0, float('nan'))``。" #: ../../library/cmath.rst:306 msgid "" @@ -329,6 +380,10 @@ msgid "" "as a real number (in which case the complex number has an imaginary part of " "zero)." msgstr "" +"請注意,函式的選擇與模組 :mod:`math` 的類似,但並不完全相同。擁有兩個模組的原" +"因是有些用戶對複數不感興趣,甚至根本就不知道它們是什麼。他們寧願讓 ``math." +"sqrt(-1)`` 引發異常,也不願它回傳複數。另請注意, :mod:`cmath` 中所定義的函式" +"始終都會回傳複數,即使答案可以表示為實數(在這種情況下,複數的虛部為零)。" #: ../../library/cmath.rst:314 msgid "" @@ -340,6 +395,10 @@ msgid "" "choice of branch cuts for numerical purposes, a good reference should be the " "following:" msgstr "" +"關於分枝切割的註釋:它們是沿著給定的不連續函式的曲線。它們是許多複變函數的必" +"要特徵。假設您需要使用複變函數進行計算,您將會了解分枝切割的概念。請參閱幾乎" +"所有關於複變函數的(不是太初級的)書籍以獲得啟發。對於如何正確地基於數值目的" +"選擇分枝切割的相關訊息,以下內容應該是一個很好的參考:" #: ../../library/cmath.rst:324 msgid "" From 2d1c8fb93caef8c471590e9f88824698a354fdb9 Mon Sep 17 00:00:00 2001 From: Enkai Huang Date: Thu, 14 Mar 2024 03:14:55 +0000 Subject: [PATCH 4/4] fix typo --- library/cmath.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cmath.po b/library/cmath.po index 219d52293f..1d0989d677 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-06-30 15:31+0000\n" "PO-Revision-Date: 2024-03-14 09:26+0800\n" -"Last-Translator: Adrian Liaw \n" +"Last-Translator: Enkai Huang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -158,7 +158,7 @@ msgid "" "specified, returns the natural logarithm of *x*. There is one branch cut, " "from 0 along the negative real axis to -∞." msgstr "" -"回傳 *x* 給定 *base* 的對數。如果未指定 *base* ,則傳回 *x* 的自然對數。存在" +"回傳 *x* 給定 *base* 的對數。如果未指定 *base*,則傳回 *x* 的自然對數。存在" "一條分枝切割,從 0 沿負實數軸到 -∞。" #: ../../library/cmath.rst:114