Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87cb8f0

Browse files
committed
Translate faq/design.html#why-are-floating-point-calculations-so-inaccurate
1 parent135961e commit87cb8f0

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

‎faq/design.po‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgstr ""
99
"Project-Id-Version:Python 3.10\n"
1010
"Report-Msgid-Bugs-To:\n"
1111
"POT-Creation-Date:2022-07-06 00:17+0000\n"
12-
"PO-Revision-Date:2022-08-12 17:43+0800\n"
12+
"PO-Revision-Date:2022-08-14 20:54+0800\n"
1313
"Last-Translator:Adrian Liaw <adrianliaw2000@gmail.com>\n"
1414
"Language-Team:Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1515
"tw)\n"
@@ -86,29 +86,39 @@ msgid ""
8686
"brackets -- the lack of declarations and the high-level data types are also "
8787
"responsible -- but the indentation-based syntax certainly helps."
8888
msgstr""
89+
"很多程式碼風格會把 begin/end 獨立放在一行。這會讓程式碼很長且浪費珍貴的螢幕空"
90+
"間,要概覽程式時也變得較為困難。理想上來說,一個函式應該要佔一個螢幕(大概 "
91+
"20 至 30 行)。20 行的 Python 程式碼比起 20 行的 C 程式碼可以做更多事。這不單"
92+
"單只是沒有 begin/end 括號 ── 也因為沒有變數宣告及高階的資料型別 ── 但縮排式的"
93+
"語法確實給了幫助。"
8994

9095
#:../../faq/design.rst:48
9196
msgid"Why am I getting strange results with simple arithmetic operations?"
92-
msgstr""
97+
msgstr"為何我會從簡單的算術運算中得到奇怪的結果?"
9398

9499
#:../../faq/design.rst:50
95100
msgid"See the next question."
96101
msgstr"請見下一個問題。"
97102

98103
#:../../faq/design.rst:54
99104
msgid"Why are floating-point calculations so inaccurate?"
100-
msgstr"為何浮點數運算如此不精確?"
105+
msgstr"為何浮點數運算如此不精確"
101106

102107
#:../../faq/design.rst:56
103108
msgid"Users are often surprised by results like this::"
104109
msgstr""
110+
"使用者常常對這種結果感到驚訝:\n"
111+
"\n"
112+
"::"
105113

106114
#:../../faq/design.rst:61
107115
msgid""
108116
"and think it is a bug in Python. It's not. This has little to do with "
109117
"Python, and much more to do with how the underlying platform handles "
110118
"floating-point numbers."
111119
msgstr""
120+
"然後認為這是 Python 的 bug。但這並不是。這跟 Python 幾乎沒有關係,而是和底層"
121+
"如何處理浮點數有關係。"
112122

113123
#:../../faq/design.rst:65
114124
msgid""
@@ -119,35 +129,52 @@ msgid ""
119129
"point operations. This means that as far as floating-point operations are "
120130
"concerned, Python behaves like many popular languages including C and Java."
121131
msgstr""
132+
"CPython 的 :class:`float` 型別使用了 C 的 ``double`` 型別來儲存。一個 class:"
133+
"`float` 物件的值會以固定的精度(通常為 53 位元)存為二進制浮點數,Python 使"
134+
"用 C 來運算浮點數,而他的結果會依處理器中的硬體實作方式來決定。這表示就浮點數"
135+
"運算來說,Python 和 C、Java 等很多受歡迎的語言有一樣的表現。"
122136

123137
#:../../faq/design.rst:72
124138
msgid""
125139
"Many numbers that can be written easily in decimal notation cannot be "
126140
"expressed exactly in binary floating-point. For example, after::"
127141
msgstr""
142+
"很多數字可以簡單地寫成十進位表示,但卻無法簡單地變成二進制表示。比方說,在以"
143+
"下程式碼執行後:\n"
144+
"\n"
145+
"::"
128146

129147
#:../../faq/design.rst:77
130148
msgid""
131149
"the value stored for ``x`` is a (very good) approximation to the decimal "
132150
"value ``1.2``, but is not exactly equal to it. On a typical machine, the "
133151
"actual stored value is::"
134152
msgstr""
153+
"``x`` 裡的值是一個(很接近)1.2 的估計值,但並非精確地等於 1.2。以一般的電腦"
154+
"來說,他實際儲存的值是:\n"
155+
"\n"
156+
"::"
135157

136158
#:../../faq/design.rst:83
137159
msgid"which is exactly::"
138160
msgstr""
161+
"而這個值正是:\n"
162+
"\n"
163+
"::"
139164

140165
#:../../faq/design.rst:87
141166
msgid""
142167
"The typical precision of 53 bits provides Python floats with 15--16 decimal "
143168
"digits of accuracy."
144-
msgstr""
169+
msgstr"53 位元的精度讓 Python 可以有 15 至 16 小數位的準確度。"
145170

146171
#:../../faq/design.rst:90
147172
msgid""
148173
"For a fuller explanation, please see the :ref:`floating point arithmetic "
149174
"<tut-fp-issues>` chapter in the Python tutorial."
150175
msgstr""
176+
"要更完全的解釋可以查閱在 Python 教學的\\ :ref:`浮點運算 <tut-fp-issues>`\\ 一"
177+
"章。"
151178

152179
#:../../faq/design.rst:95
153180
msgid"Why are Python strings immutable?"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp