@@ -28,7 +28,6 @@ msgid "Floating Point Arithmetic: Issues and Limitations"
2828msgstr "浮點數運算:問題與限制"
2929
3030#: ../../tutorial/floatingpoint.rst:16
31- #, fuzzy
3231msgid ""
3332"Floating-point numbers are represented in computer hardware as base 2 "
3433"(binary) fractions. For example, the **decimal** fraction ``0.625`` has "
@@ -38,8 +37,8 @@ msgid ""
3837"fractional notation, and the second in base 2."
3938msgstr ""
4039"在計算機架構中,浮點數 (floating-point number) 是以基數為 2(二進位)的小數表"
41- "示。例如說,在\\ **十進位**\\ 小數中 ``0.125 `` 可被分為 1 /10 + 2/100 + "
42- "5/1000,同樣的道理,\\ **二進位**\\ 小數 ``0.001 `` 可被分為 0 /2 + 0/4 + 1/8。"
40+ "示。例如說,在\\ **十進位**\\ 小數中 ``0.625 `` 可被分為 6 /10 + 2/100 + "
41+ "5/1000,同樣的道理,\\ **二進位**\\ 小數 ``0.101 `` 可被分為 1 /2 + 0/4 + 1/8。"
4342"這兩個小數有相同的數值,而唯一真正的不同在於前者以十進位表示,後者以二進位表"
4443"示。"
4544
@@ -105,7 +104,6 @@ msgstr ""
105104"55``,而這樣的表示十分地接近,但不完全等同於 1/10 的真正數值。"
106105
107106#: ../../tutorial/floatingpoint.rst:58
108- #, fuzzy
109107msgid ""
110108"Many users are not aware of the approximation because of the way values are "
111109"displayed. Python only prints a decimal approximation to the true decimal "
@@ -121,15 +119,12 @@ msgstr ""
121119"::"
122120
123121#: ../../tutorial/floatingpoint.rst:67
124- #, fuzzy
125122msgid ""
126123"That is more digits than most people find useful, so Python keeps the number "
127124"of digits manageable by displaying a rounded value instead:"
128125msgstr ""
129126"這比一般人感到有用的位數還多,所以 Python 將位數保持在可以接受的範圍,只顯示"
130- "捨入後的數值:\n"
131- "\n"
132- "::"
127+ "捨入後的數值:"
133128
134129#: ../../tutorial/floatingpoint.rst:75
135130msgid ""
@@ -180,15 +175,12 @@ msgstr ""
180175"都不會顯示。)"
181176
182177#: ../../tutorial/floatingpoint.rst:97
183- #, fuzzy
184178msgid ""
185179"For more pleasant output, you may wish to use string formatting to produce a "
186180"limited number of significant digits:"
187181msgstr ""
188182"為求更優雅的輸出,你可能想要使用字串的格式化 (string formatting) 產生限定的有"
189- "效位數:\n"
190- "\n"
191- "::"
183+ "效位數:"
192184
193185#: ../../tutorial/floatingpoint.rst:111
194186msgid ""
@@ -199,36 +191,28 @@ msgstr ""
199191"正機器數值所\\ *展示的值*\\ 。"
200192
201193#: ../../tutorial/floatingpoint.rst:114
202- #, fuzzy
203194msgid ""
204195"One illusion may beget another. For example, since 0.1 is not exactly 1/10, "
205196"summing three values of 0.1 may not yield exactly 0.3, either:"
206197msgstr ""
207198"這種幻覺可能會產生下一個幻覺。舉例來說,因為 0.1 不是真正的 1/10,把三個 0.1 "
208- "的值相加,也不會產生精準的 0.3:\n"
209- "\n"
210- "::"
199+ "的值相加,也不會產生精準的 0.3:"
211200
212201#: ../../tutorial/floatingpoint.rst:122
213- #, fuzzy
214202msgid ""
215203"Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 "
216204"cannot get any closer to the exact value of 3/10, then pre-rounding with :"
217205"func:`round` function cannot help:"
218206msgstr ""
219207"同時,因為 0.1 不能再更接近精準的 1/10,還有 0.3 不能再更接近精準的 3/10,預"
220- "先用 :func:`round` 函式捨入並不會有幫助:\n"
221- "\n"
222- "::"
208+ "先用 :func:`round` 函式捨入並不會有幫助:"
223209
224210#: ../../tutorial/floatingpoint.rst:131
225- #, fuzzy
226211msgid ""
227212"Though the numbers cannot be made closer to their intended exact values, "
228213"the :func:`math.isclose` function can be useful for comparing inexact values:"
229214msgstr ""
230- "雖然數字不會再更接近他們的精準數值,但 :func:`round` 函式可以對事後的捨入有所"
231- "幫助,如此一來,不精確的數值就變得可以互相比較:\n"
215+ "雖然數字不會再更接近他們的精準數值,但 :func:`math.isclose` 函式可以用來比較不精確的值:\n"
232216"\n"
233217"::"
234218
@@ -314,48 +298,35 @@ msgstr ""
314298"的許多用於數學和統計學運算的其他套件。請參閱 <https://scipy.org>。"
315299
316300#: ../../tutorial/floatingpoint.rst:181
317- #, fuzzy
318301msgid ""
319302"Python provides tools that may help on those rare occasions when you really "
320303"*do* want to know the exact value of a float. The :meth:`float."
321304"as_integer_ratio` method expresses the value of a float as a fraction:"
322305msgstr ""
323306"在罕見情況下,當你\\ *真的*\\ 想知道一個 float 的精準值,Python 提供的工具可"
324307"協助達成。\\ :meth:`float.as_integer_ratio` method 可將一個 float 的值表示為"
325- "分數:\n"
326- "\n"
327- "::"
308+ "分數:"
328309
329310#: ../../tutorial/floatingpoint.rst:192
330- #, fuzzy
331311msgid ""
332312"Since the ratio is exact, it can be used to losslessly recreate the original "
333313"value:"
334314msgstr ""
335- "由於該比率是精準的,它可無損地再現該原始值:\n"
336- "\n"
337- "::"
315+ "由於該比率是精準的,它可無損地再現該原始值:"
338316
339317#: ../../tutorial/floatingpoint.rst:200
340- #, fuzzy
341318msgid ""
342319"The :meth:`float.hex` method expresses a float in hexadecimal (base 16), "
343320"again giving the exact value stored by your computer:"
344321msgstr ""
345322":meth:`float.hex` method 以十六進位(基數為 16)表示 float,一樣可以給出你的"
346- "電腦所儲存的精準值:\n"
347- "\n"
348- "::"
323+ "電腦所儲存的精準值:"
349324
350325#: ../../tutorial/floatingpoint.rst:208
351- #, fuzzy
352326msgid ""
353327"This precise hexadecimal representation can be used to reconstruct the float "
354328"value exactly:"
355- msgstr ""
356- "這種精確的十六進位表示法可用於精準地重建 float 值:\n"
357- "\n"
358- "::"
329+ msgstr "這種精確的十六進位表示法可用於精準地重建 float 值:"
359330
360331#: ../../tutorial/floatingpoint.rst:216
361332msgid ""
@@ -443,36 +414,26 @@ msgstr ""
443414"::"
444415
445416#: ../../tutorial/floatingpoint.rst:286
446- #, fuzzy
447417msgid ""
448418"and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< "
449419"2**53``), the best value for *N* is 56:"
450420msgstr ""
451421"而前面提到 *J* 有精準的 53 位元(即 ``>= 2**52`` 但 ``< 2**53``),所以 *N* "
452- "的最佳數值是 56:\n"
453- "\n"
454- "::"
422+ "的最佳數值是 56:"
455423
456424#: ../../tutorial/floatingpoint.rst:294
457- #, fuzzy
458425msgid ""
459426"That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. "
460427"The best possible value for *J* is then that quotient rounded:"
461428msgstr ""
462429"意即,要使 *J* 正好有 53 位元,則 56 會是 *N* 的唯一值。而 *J* 最有可能的數值"
463- "就是經過捨入後的該商數:\n"
464- "\n"
465- "::"
430+ "就是經過捨入後的該商數:"
466431
467432#: ../../tutorial/floatingpoint.rst:303
468- #, fuzzy
469433msgid ""
470434"Since the remainder is more than half of 10, the best approximation is "
471435"obtained by rounding up:"
472- msgstr ""
473- "由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:\n"
474- "\n"
475- "::"
436+ msgstr "由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:"
476437
477438#: ../../tutorial/floatingpoint.rst:313
478439msgid ""
@@ -511,17 +472,12 @@ msgstr ""
511472"::"
512473
513474#: ../../tutorial/floatingpoint.rst:334
514- #, fuzzy
515475msgid ""
516476"If we multiply that fraction by 10\\ *\\ *55, we can see the value out to 55 "
517477"decimal digits:"
518- msgstr ""
519- "如果將該分數乘以 10\\ *\\ *55,則可以看到該值以 55 個十進位數字顯示:\n"
520- "\n"
521- "::"
478+ msgstr "如果將該分數乘以 10\\ *\\ *55,則可以看到該值以 55 個十進位數字顯示:"
522479
523480#: ../../tutorial/floatingpoint.rst:342
524- #, fuzzy
525481msgid ""
526482"meaning that the exact number stored in the computer is equal to the decimal "
527483"value 0.1000000000000000055511151231257827021181583404541015625. Instead of "
@@ -530,32 +486,9 @@ msgid ""
530486msgstr ""
531487"這表示儲存在電腦中的精準數值等於十進位值 "
532488"0.1000000000000000055511151231257827021181583404541015625。與其顯示完整的十進"
533- "位數值,許多語言(包括 Python 的舊版本)選擇將結果捨入至 17 個有效位數:\n"
534- "\n"
535- "::"
489+ "位數值,許多語言(包括 Python 的舊版本)選擇將結果捨入至 17 個有效位數:"
536490
537491#: ../../tutorial/floatingpoint.rst:352
538- #, fuzzy
539492msgid ""
540493"The :mod:`fractions` and :mod:`decimal` modules make these calculations easy:"
541- msgstr ""
542- ":mod:`fractions` 與 :mod:`decimal` 模組能使這些計算變得容易:\n"
543- "\n"
544- "::"
545-
546- #~ msgid ""
547- #~ "Floating-point numbers are represented in computer hardware as base 2 "
548- #~ "(binary) fractions. For example, the decimal fraction ::"
549- #~ msgstr ""
550- #~ "在計算機架構中,浮點數 (floating-point number) 是以基數為 2(二進位)的小"
551- #~ "數表示。例如說,在十進位小數中:\n"
552- #~ "\n"
553- #~ "::"
554-
555- #~ msgid ""
556- #~ "has value 1/10 + 2/100 + 5/1000, and in the same way the binary "
557- #~ "fraction ::"
558- #~ msgstr ""
559- #~ "可被分為 1/10 + 2/100 + 5/1000,同樣的道理,二進位小數:\n"
560- #~ "\n"
561- #~ "::"
494+ msgstr ":mod:`fractions` 與 :mod:`decimal` 模組能使這些計算變得容易:"
0 commit comments