Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate library/math.po rst: 30-101 #800

Merged
merged 12 commits into from
Feb 6, 2024
34 changes: 28 additions & 6 deletions library/math.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-17 17:39+0800\n"
"PO-Revision-Date: 2024-01-03 17:00+0800\n"
"PO-Revision-Date: 2024-01-14 01:32+0800\n"
"Last-Translator: Adrian Liaw <[email protected]>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand Down Expand Up @@ -53,66 +53,80 @@ msgstr "此模組提供下列函式。除非特意註明,否則回傳值皆為

#: ../../library/math.rst:30
msgid "Number-theoretic and representation functions"
msgstr ""
msgstr "數論與表現函式"

#: ../../library/math.rst:34
msgid ""
"Return the ceiling of *x*, the smallest integer greater than or equal to "
"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ <object."
"__ceil__>`, which should return an :class:`~numbers.Integral` value."
msgstr ""
"回傳 *x* 經上取整函數的值,即大於或等於 *x* 的最小整數。若 *x* 並非浮點數,此"
Carisa-Li marked this conversation as resolved.
Show resolved Hide resolved
"函式將委託給 :meth:`x.__ceil__ <object.__ceil__>`,並回傳 :class:`~numbers."
Carisa-Li marked this conversation as resolved.
Show resolved Hide resolved
"Integral` 型別的值。"

#: ../../library/math.rst:41
msgid ""
"Return the number of ways to choose *k* items from *n* items without "
"repetition and without order."
msgstr ""
msgstr "回傳從 *n* 個物品中不重複且不考慮排序地取出 *k* 個物品的方法數。"

#: ../../library/math.rst:44
msgid ""
"Evaluates to ``n! / (k! * (n - k)!)`` when ``k <= n`` and evaluates to zero "
"when ``k > n``."
msgstr ""
msgstr "當 ``k <= n`` 時回傳 ``n! / (k! * (n - k)!)``,否則回傳 ``0``。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evaluates to 這裡我覺得不會是回傳(畢竟有個return卡住這個翻譯了)
樂詞網是翻譯成 評估或求值
但這裡的中文翻譯如果考慮順暢度我可能會翻成 得出
老樣子 可以討論

Suggested change
msgstr "當 ``k <= n`` 時回傳 ``n! / (k! * (n - k)!)``,否則回傳 ``0``。"
msgstr "當 ``k <= n`` 時得出 ``n! / (k! * (n - k)!)``,否則得出 ``0``。"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因evaluates to zero,所以我認為評估或求值皆不太通順,若要避免使用回傳,我想修改成「其值為」。


#: ../../library/math.rst:47
msgid ""
"Also called the binomial coefficient because it is equivalent to the "
"coefficient of k-th term in polynomial expansion of ``(1 + x)ⁿ``."
msgstr ""
"因為此值等同於 ``(1 + x)ⁿ`` 進行多項式展開後第 k 項的係數,所以又稱為二項式係"
"數。"

#: ../../library/math.rst:51 ../../library/math.rst:258
msgid ""
"Raises :exc:`TypeError` if either of the arguments are not integers. Raises :"
"exc:`ValueError` if either of the arguments are negative."
msgstr ""
"當任一參數非整數型別時會引發 :exc:`TypeError`。當任一參數為負數時會引發 :exc:"
"`ValueError`。"

#: ../../library/math.rst:59
msgid ""
"Return a float with the magnitude (absolute value) of *x* but the sign of "
"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` "
"returns *-1.0*."
msgstr ""
"回傳與 *x* 相同長度(絕對值)且與 *y* 同號的浮點數。在支援帶符號零的平臺上,"
Carisa-Li marked this conversation as resolved.
Show resolved Hide resolved
"``copysign(1.0, -0.0)`` 回傳 *-1.0*。"

#: ../../library/math.rst:66
msgid "Return the absolute value of *x*."
msgstr ""
msgstr "回傳 *x* 的絕對值。"

#: ../../library/math.rst:71
msgid ""
"Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not "
"integral or is negative."
msgstr ""
"以整數型別回傳 *n* 的階乘。若 *n* 非整數型別或其值為負會引發 :exc:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : integer 應該是可以翻成整數 型別稍微有點多翻,這個問題前後文都有一點,雖然出現是不影響語意,但已翻譯的角度來說我個人是認為不干擾流暢度的情況下盡量不多加翻譯的內容,這邊可以討論~

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integral 如果原文沒有打錯應該是代表積分,這邊應該就不是整數的意思

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我開始覺得 python 的 Integral 不是積分而是這個了
https://docs.python.org/3/library/numbers.html#numbers.Integral
但這個就是一個更上層的抽象數值類別...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我同意型別不影響語意,會在修掉。
Integral經傳入字串參數後,確認為類別名,故同樣參照c-api/intro rst:573處,翻為整數型別。

"`ValueError`。"

#: ../../library/math.rst:74
msgid "Accepting floats with integral values (like ``5.0``) is deprecated."
msgstr ""
msgstr "允許傳入其值為整數的浮點數(如:``5.0``)已被棄用。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

integral應該是積分,但我越來越懷疑原文打錯了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考慮到python有名為Integral的類別名,並於線上python3.6編譯器進行測試後,確認此處為整數之義。


#: ../../library/math.rst:80
msgid ""
"Return the floor of *x*, the largest integer less than or equal to *x*. If "
"*x* is not a float, delegates to :meth:`x.__floor__ <object.__floor__>`, "
"which should return an :class:`~numbers.Integral` value."
msgstr ""
"回傳 *x* 經下取整函數的值,即小於或等於 *x* 的最大整數。若 *x* 並非浮點數,此"
Carisa-Li marked this conversation as resolved.
Show resolved Hide resolved
"函式將委託給 :meth:`x.__floor__ <object.__floor__>`,並回傳 :class:`~numbers."
Carisa-Li marked this conversation as resolved.
Show resolved Hide resolved
"Integral` 型別的值。"

#: ../../library/math.rst:87
msgid ""
Expand All @@ -129,6 +143,14 @@ msgid ""
"generally preferred when working with floats, while Python's ``x % y`` is "
"preferred when working with integers."
msgstr ""
"回傳和 C 函式庫中 ``fmod(x, y)`` 函式相同的值。請注意此值與 Python 運算式 "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined不見了,然後好像也不太對

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"回傳和 C 函式庫中 ``fmod(x, y)`` 函式相同的值。請注意此值與 Python 運算式 "
"回傳和 C 函式庫中定義的 ``fmod(x, y)``。請注意此值與 Python 運算式 "

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

後面這句應該是
請注意 Python 運算式 ...可能不會回傳相同的結果

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

回傳和 C 函式庫中定義的 fmod(x, y)
我認為「和」字會導致句子看似不完整,但刪除「和」字後,有被誤讀為回傳一個函式而非值的可能,這部分我會再加思考。

"``x % y`` 的結果可能不同。C 標準定義 ``fmod(x, y)`` 的回傳值完全等同(數學定"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這裡原文的斷句應該要再看一下 我的理解是這樣斷句
The intent of the C standard is that fmod(x, y) be exactly (mathematically; to infinite precision) equal to x - n*y
for some integer n (所以這句可以搬到最前面)
such that
the result has the same sign as x and magnitude less than abs(y)
老樣子 可以討論

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我認為這幾句有順序關係,the result...為n的解釋,而for some integer n such that ...是x-n*y的補充說明,調換語句會影響到句義。

"義上,即無限精度)於 ``x - n*y``,*n* 為使回傳值與 *x* 同號且長度小於 "
"``abs(y)`` 的整數;Python 運算式 ``x % y`` 的回傳值則與 *y* 同號,且可能無法"
"精確地計算浮點數。例如:``fmod(-1e-100, 1e100)`` 的回傳值為 ``-1e-100``,但 "
"``-1e-100 % 1e100`` 的回傳值為 ``1e100-1e-100``,此值無法準確地以浮點數表示,"
"並會四捨五入為令人驚訝的 ``1e100``。因此,處理浮點數時通常建議使用 :func:"
"`fmod`,而處理整數時建議使用 ``x % y``。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這段先重翻吧?
原文漏了例如 argument 的翻譯,也多出了些不存在的詞,還有上述問題
這邊就留到下個review

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感謝您的協助與建議。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用這麼客氣lol


#: ../../library/math.rst:102
msgid ""
Expand Down
Loading