From 7e0e09a837c627c447d3cefa99f2b93b05adbd9d Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Tue, 23 Apr 2024 00:49:48 +0800 Subject: [PATCH 1/9] rst: 102-222 --- library/math.po | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/library/math.po b/library/math.po index f35448010e..8b2ff6ef60 100644 --- a/library/math.po +++ b/library/math.po @@ -158,12 +158,17 @@ msgid "" "zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " "to \"pick apart\" the internal representation of a float in a portable way." msgstr "" +"以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整" +"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零回傳 ``(0.0, 0)``,否則令 " +"``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" #: ../../library/math.rst:110 msgid "" "Return an accurate floating point sum of values in the iterable. Avoids " "loss of precision by tracking multiple intermediate partial sums." msgstr "" +"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和以" +"避免精確度損失。" #: ../../library/math.rst:113 msgid "" @@ -173,6 +178,9 @@ msgid "" "occasionally double-round an intermediate sum causing it to be off in its " "least significant bit." msgstr "" +"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨模式。於有些非 " +"Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過程中同一" +"部分和重複捨入,並使其最低有效位不如預期。" #: ../../library/math.rst:119 msgid "" @@ -180,6 +188,8 @@ msgid "" "cookbook recipes for accurate floating point summation `_\\." msgstr "" +"更深入的討論及兩種替代做法請參閱 `ASPN cookbook recipes 精準的浮點數總和 " +"`_。" #: ../../library/math.rst:126 msgid "" @@ -189,24 +199,27 @@ msgid "" "zero, then the returned value is ``0``. ``gcd()`` without arguments returns " "``0``." msgstr "" +"回傳指定引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中最大" +"的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數也將" +"回傳 ``0``。" #: ../../library/math.rst:134 msgid "" "Added support for an arbitrary number of arguments. Formerly, only two " "arguments were supported." -msgstr "" +msgstr "新增支援任意數量的引數。先前僅支援兩個引數。" #: ../../library/math.rst:141 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." -msgstr "" +msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``False``。" #: ../../library/math.rst:144 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." -msgstr "" +msgstr "兩數是否足夠接近取決於給定的絕對及相對容差。" #: ../../library/math.rst:147 msgid "" @@ -216,18 +229,24 @@ 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* 須大於 ``0``。" #: ../../library/math.rst:153 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* 須大於 ``0``。" #: ../../library/math.rst:156 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/math.rst:159 msgid "" @@ -236,27 +255,34 @@ msgid "" "close to any other value, including ``NaN``. ``inf`` and ``-inf`` are only " "considered close to themselves." msgstr "" +"定義於 IEEE 754 浮點標準中的特殊值 ``NaN``、``inf`` 和 ``-inf`` 會根據該標準" +"處理。更明確地說,``NaN`` 不會與包含自身在內的任何數字足夠接近,而 ``inf`` " +"及 ``-inf`` 皆只與自身接近。" #: ../../library/math.rst:168 msgid ":pep:`485` -- A function for testing approximate equality" -msgstr "" +msgstr ":pep:`485` ── 用於測試近似相等的函式" #: ../../library/math.rst:173 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" msgstr "" +"若 *x* 不是無限值或 ``NaN`` 便回傳 ``True``,否則回傳 ``False``。(注意 " +"``0.0`` 被視為有限數。)" #: ../../library/math.rst:181 msgid "" "Return ``True`` if *x* is a positive or negative infinity, and ``False`` " "otherwise." -msgstr "" +msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 ``False``。" #: ../../library/math.rst:187 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" +"若 *x* 是 ``NaN`` ── 即非數字(not a number)── 便回傳 ``True``,否則回傳 " +"``False``。" #: ../../library/math.rst:192 msgid "" @@ -264,6 +290,8 @@ msgid "" "floor of the exact square root of *n*, or equivalently the greatest integer " "*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." msgstr "" +"回傳非負整數 *n* 的整數平方根。此值為 *n* 精確平方根經下取整的值,亦等同於滿" +"足 ``a² ≤ n`` 的最大整數值 *a*。" #: ../../library/math.rst:196 msgid "" @@ -272,6 +300,9 @@ msgid "" "the exact square root of *n*. For positive *n*, this can be computed using " "``a = 1 + isqrt(n - 1)``." msgstr "" +"於有些應用中,取得滿足 ``n ≤ a²`` 的最小整數值 *a* ── 或者說 *n* 精確平方根經" +"上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = 1 + isqrt(n - 1)`` 計" +"算。" #: ../../library/math.rst:206 msgid "" @@ -281,12 +312,15 @@ msgid "" "zero, then the returned value is ``0``. ``lcm()`` without arguments returns " "``1``." msgstr "" +"回傳指定引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中最小" +"的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何引數" +"將回傳 ``1``。" #: ../../library/math.rst:217 msgid "" "Return ``x * (2**i)``. This is essentially the inverse of function :func:" "`frexp`." -msgstr "" +msgstr "回傳 ``x * (2**i)``。此函式本質上為 :func:`frexp` 的反函式。" #: ../../library/math.rst:223 msgid "" From 6b067f968ac30005596bf69bdd4d53ec10b3163e Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:31:50 +0800 Subject: [PATCH 2/9] Update library/math.po Co-authored-by: Wei-Hsiang (Matt) Wang --- library/math.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/math.po b/library/math.po index 8b2ff6ef60..1a42aac20d 100644 --- a/library/math.po +++ b/library/math.po @@ -199,7 +199,7 @@ msgid "" "zero, then the returned value is ``0``. ``gcd()`` without arguments returns " "``0``." msgstr "" -"回傳指定引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中最大" +"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中最大" "的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數也將" "回傳 ``0``。" From 4b70fef7eced361c8750b880dfe91f12b543add9 Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:32:03 +0800 Subject: [PATCH 3/9] Update library/math.po Co-authored-by: Wei-Hsiang (Matt) Wang --- library/math.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/math.po b/library/math.po index 1a42aac20d..fc3807b91b 100644 --- a/library/math.po +++ b/library/math.po @@ -281,7 +281,7 @@ msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" -"若 *x* 是 ``NaN`` ── 即非數字(not a number)── 便回傳 ``True``,否則回傳 " +"若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回傳 " "``False``。" #: ../../library/math.rst:192 From f06ee555feab438e3670dd9212216e67594e0aec Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:32:13 +0800 Subject: [PATCH 4/9] Update library/math.po Co-authored-by: Wei-Hsiang (Matt) Wang --- library/math.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/math.po b/library/math.po index fc3807b91b..76606412c9 100644 --- a/library/math.po +++ b/library/math.po @@ -291,7 +291,7 @@ msgid "" "*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." msgstr "" "回傳非負整數 *n* 的整數平方根。此值為 *n* 精確平方根經下取整的值,亦等同於滿" -"足 ``a² ≤ n`` 的最大整數值 *a*。" +"足 *a*\\ ² |nbsp| ≤ |nbsp| *n* 的最大整數值 *a*。" #: ../../library/math.rst:196 msgid "" From 8853a0159f91eb5236b374988cddc880f58ddabb Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:32:29 +0800 Subject: [PATCH 5/9] Update library/math.po Co-authored-by: Wei-Hsiang (Matt) Wang --- library/math.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/math.po b/library/math.po index 76606412c9..1265b3d053 100644 --- a/library/math.po +++ b/library/math.po @@ -300,7 +300,7 @@ msgid "" "the exact square root of *n*. For positive *n*, this can be computed using " "``a = 1 + isqrt(n - 1)``." msgstr "" -"於有些應用中,取得滿足 ``n ≤ a²`` 的最小整數值 *a* ── 或者說 *n* 精確平方根經" +"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或者說 *n* 精確平方根經" "上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = 1 + isqrt(n - 1)`` 計" "算。" From 76e7611d96223a895130bb8e538a681c6c75f137 Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:32:44 +0800 Subject: [PATCH 6/9] Update library/math.po Co-authored-by: Wei-Hsiang (Matt) Wang --- library/math.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/math.po b/library/math.po index 1265b3d053..86c43db8d0 100644 --- a/library/math.po +++ b/library/math.po @@ -312,7 +312,7 @@ msgid "" "zero, then the returned value is ``0``. ``lcm()`` without arguments returns " "``1``." msgstr "" -"回傳指定引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中最小" +"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中最小" "的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何引數" "將回傳 ``1``。" From 74a9ba6d962d94aad5146f89533f55004f616788 Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:36:24 +0800 Subject: [PATCH 7/9] add original text --- library/math.po | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/library/math.po b/library/math.po index 86c43db8d0..c1261846a4 100644 --- a/library/math.po +++ b/library/math.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-03-14 00:03+0000\n" -"PO-Revision-Date: 2024-02-05 16:30+0800\n" +"PO-Revision-Date: 2024-04-26 14:35+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -167,8 +167,8 @@ msgid "" "Return an accurate floating point sum of values in the iterable. Avoids " "loss of precision by tracking multiple intermediate partial sums." msgstr "" -"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和以" -"避免精確度損失。" +"回傳可疊代物件(iterable)中所有值的精確浮點數和。透過追蹤過程中多個部分和" +"(partial sum)以避免精確度損失。" #: ../../library/math.rst:113 msgid "" @@ -178,9 +178,9 @@ msgid "" "occasionally double-round an intermediate sum causing it to be off in its " "least significant bit." msgstr "" -"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨模式。於有些非 " -"Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過程中同一" -"部分和重複捨入,並使其最低有效位不如預期。" +"此演算法準確性奠基於保證 IEEE-754 浮點標準及典型奇進偶捨(half-even)模式。於" +"有些非 Windows 平台建置時,底層 C 函式庫使用延伸精度加法運算,而可能導致對過" +"程中同一部分和重複捨入,並使其最低有效位不如預期。" #: ../../library/math.rst:119 msgid "" @@ -199,9 +199,9 @@ msgid "" "zero, then the returned value is ``0``. ``gcd()`` without arguments returns " "``0``." msgstr "" -"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中最大" -"的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數也將" -"回傳 ``0``。" +"回傳指定整數引數的最大公因數。若存在任一非零引數,回傳值為所有引數共有因數中" +"最大的正整數。若所有引數皆為零,則回傳值為 ``0``。``gcd()`` 若未傳入任何引數" +"也將回傳 ``0``。" #: ../../library/math.rst:134 msgid "" @@ -281,8 +281,8 @@ msgstr "若 *x* 是正無限值或負無限值便回傳 ``True``,否則回傳 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" -"若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回傳 " -"``False``。" +"若 *x* 是 ``NaN`` ── 即非數字(NaN, not a number)── 便回傳 ``True``,否則回" +"傳 ``False``。" #: ../../library/math.rst:192 msgid "" @@ -300,9 +300,9 @@ msgid "" "the exact square root of *n*. For positive *n*, this can be computed using " "``a = 1 + isqrt(n - 1)``." msgstr "" -"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或者說 *n* 精確平方根經" -"上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = 1 + isqrt(n - 1)`` 計" -"算。" +"於有些應用程式中,取得滿足 *n* |nbsp| ≤ |nbsp| *a*\\ ² 的最小整數值 *a* ── 或" +"者說 *n* 精確平方根經上取整的值 ── 會更加方便。對正數 *n*,此值可使用 ``a = " +"1 + isqrt(n - 1)`` 計算。" #: ../../library/math.rst:206 msgid "" @@ -312,9 +312,9 @@ msgid "" "zero, then the returned value is ``0``. ``lcm()`` without arguments returns " "``1``." msgstr "" -"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中最小" -"的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何引數" -"將回傳 ``1``。" +"回傳指定整數引數的最小公倍數。若所有引數值皆非零,回傳值為所有引數共有倍數中" +"最小的正整數。若存在任一引數值為零,則回傳值為 ``0``。``lcm()`` 若未傳入任何" +"引數將回傳 ``1``。" #: ../../library/math.rst:217 msgid "" From 6adc91dde90661a8eb7e01d3464413482e625bee Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 14:58:49 +0800 Subject: [PATCH 8/9] Update library/math.po Co-authored-by: Payon --- library/math.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/math.po b/library/math.po index c1261846a4..429f7eb29a 100644 --- a/library/math.po +++ b/library/math.po @@ -159,7 +159,7 @@ msgid "" "to \"pick apart\" the internal representation of a float in a portable way." msgstr "" "以 ``(m, e)`` 對的格式回傳 *x* 的尾數 *m* 及指數 *e*。*m* 是浮點數而 *e* 是整" -"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零回傳 ``(0.0, 0)``,否則令 " +"數,且兩者精確地使 ``x == m * 2**e``。若 *x* 為零,回傳 ``(0.0, 0)``,否則令 " "``0.5 <= abs(m) < 1``。此函式用於以可攜的方式「分割」浮點數內部表示法。" #: ../../library/math.rst:110 From dcd960a25d7e17804d80b85cf5cbbcca07c9c729 Mon Sep 17 00:00:00 2001 From: Carisa-Li Date: Fri, 26 Apr 2024 15:16:17 +0800 Subject: [PATCH 9/9] fix isclose --- library/math.po | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/library/math.po b/library/math.po index 429f7eb29a..81016e7b80 100644 --- a/library/math.po +++ b/library/math.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-03-14 00:03+0000\n" -"PO-Revision-Date: 2024-04-26 14:35+0800\n" +"PO-Revision-Date: 2024-04-26 15:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -219,7 +219,7 @@ msgstr "若 *a* 及 *b* 兩值足夠接近便回傳 ``True``,否則回傳 ``Fa msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." -msgstr "兩數是否足夠接近取決於給定的絕對及相對容差。" +msgstr "兩數是否足夠接近取決於給定的絕對及相對容許偏差(tolerance)。" #: ../../library/math.rst:147 msgid "" @@ -229,16 +229,18 @@ 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* 須大於 ``0``。" +"*rel_tol* 為相對容許偏差 ── *a* 與 *b* 兩數差的最大容許值,與 *a* 及 *b* 兩數" +"的絕對值中較大者相關。例如欲設置 5% 的容許偏差,則傳入 ``rel_tol=0.05``。其預" +"設值為 ``1e-09``,該值可確保兩數於大約 9 個十進數位內相同。*rel_tol* 須大於 " +"``0``。" #: ../../library/math.rst:153 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* 須大於 ``0``。" +"*abs_tol* 為最小絕對容許偏差 ── 於接近零的比較時很有用。*abs_tol* 須大於等於 " +"``0``。" #: ../../library/math.rst:156 msgid ""