@@ -28,7 +28,6 @@ msgid "Floating Point Arithmetic: Issues and Limitations"
28
28
msgstr "浮點數運算:問題與限制"
29
29
30
30
#: ../../tutorial/floatingpoint.rst:16
31
- #, fuzzy
32
31
msgid ""
33
32
"Floating-point numbers are represented in computer hardware as base 2 "
34
33
"(binary) fractions. For example, the **decimal** fraction ``0.625`` has "
@@ -38,8 +37,8 @@ msgid ""
38
37
"fractional notation, and the second in base 2."
39
38
msgstr ""
40
39
"在計算機架構中,浮點數 (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。"
43
42
"這兩個小數有相同的數值,而唯一真正的不同在於前者以十進位表示,後者以二進位表"
44
43
"示。"
45
44
@@ -105,7 +104,6 @@ msgstr ""
105
104
"55``,而這樣的表示十分地接近,但不完全等同於 1/10 的真正數值。"
106
105
107
106
#: ../../tutorial/floatingpoint.rst:58
108
- #, fuzzy
109
107
msgid ""
110
108
"Many users are not aware of the approximation because of the way values are "
111
109
"displayed. Python only prints a decimal approximation to the true decimal "
@@ -121,15 +119,12 @@ msgstr ""
121
119
"::"
122
120
123
121
#: ../../tutorial/floatingpoint.rst:67
124
- #, fuzzy
125
122
msgid ""
126
123
"That is more digits than most people find useful, so Python keeps the number "
127
124
"of digits manageable by displaying a rounded value instead:"
128
125
msgstr ""
129
126
"這比一般人感到有用的位數還多,所以 Python 將位數保持在可以接受的範圍,只顯示"
130
- "捨入後的數值:\n"
131
- "\n"
132
- "::"
127
+ "捨入後的數值:"
133
128
134
129
#: ../../tutorial/floatingpoint.rst:75
135
130
msgid ""
@@ -180,15 +175,12 @@ msgstr ""
180
175
"都不會顯示。)"
181
176
182
177
#: ../../tutorial/floatingpoint.rst:97
183
- #, fuzzy
184
178
msgid ""
185
179
"For more pleasant output, you may wish to use string formatting to produce a "
186
180
"limited number of significant digits:"
187
181
msgstr ""
188
182
"為求更優雅的輸出,你可能想要使用字串的格式化 (string formatting) 產生限定的有"
189
- "效位數:\n"
190
- "\n"
191
- "::"
183
+ "效位數:"
192
184
193
185
#: ../../tutorial/floatingpoint.rst:111
194
186
msgid ""
@@ -199,36 +191,28 @@ msgstr ""
199
191
"正機器數值所\\ *展示的值*\\ 。"
200
192
201
193
#: ../../tutorial/floatingpoint.rst:114
202
- #, fuzzy
203
194
msgid ""
204
195
"One illusion may beget another. For example, since 0.1 is not exactly 1/10, "
205
196
"summing three values of 0.1 may not yield exactly 0.3, either:"
206
197
msgstr ""
207
198
"這種幻覺可能會產生下一個幻覺。舉例來說,因為 0.1 不是真正的 1/10,把三個 0.1 "
208
- "的值相加,也不會產生精準的 0.3:\n"
209
- "\n"
210
- "::"
199
+ "的值相加,也不會產生精準的 0.3:"
211
200
212
201
#: ../../tutorial/floatingpoint.rst:122
213
- #, fuzzy
214
202
msgid ""
215
203
"Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 "
216
204
"cannot get any closer to the exact value of 3/10, then pre-rounding with :"
217
205
"func:`round` function cannot help:"
218
206
msgstr ""
219
207
"同時,因為 0.1 不能再更接近精準的 1/10,還有 0.3 不能再更接近精準的 3/10,預"
220
- "先用 :func:`round` 函式捨入並不會有幫助:\n"
221
- "\n"
222
- "::"
208
+ "先用 :func:`round` 函式捨入並不會有幫助:"
223
209
224
210
#: ../../tutorial/floatingpoint.rst:131
225
- #, fuzzy
226
211
msgid ""
227
212
"Though the numbers cannot be made closer to their intended exact values, "
228
213
"the :func:`math.isclose` function can be useful for comparing inexact values:"
229
214
msgstr ""
230
- "雖然數字不會再更接近他們的精準數值,但 :func:`round` 函式可以對事後的捨入有所"
231
- "幫助,如此一來,不精確的數值就變得可以互相比較:\n"
215
+ "雖然數字不會再更接近他們的精準數值,但 :func:`math.isclose` 函式可以用來比較不精確的值:\n"
232
216
"\n"
233
217
"::"
234
218
@@ -314,48 +298,35 @@ msgstr ""
314
298
"的許多用於數學和統計學運算的其他套件。請參閱 <https://scipy.org>。"
315
299
316
300
#: ../../tutorial/floatingpoint.rst:181
317
- #, fuzzy
318
301
msgid ""
319
302
"Python provides tools that may help on those rare occasions when you really "
320
303
"*do* want to know the exact value of a float. The :meth:`float."
321
304
"as_integer_ratio` method expresses the value of a float as a fraction:"
322
305
msgstr ""
323
306
"在罕見情況下,當你\\ *真的*\\ 想知道一個 float 的精準值,Python 提供的工具可"
324
307
"協助達成。\\ :meth:`float.as_integer_ratio` method 可將一個 float 的值表示為"
325
- "分數:\n"
326
- "\n"
327
- "::"
308
+ "分數:"
328
309
329
310
#: ../../tutorial/floatingpoint.rst:192
330
- #, fuzzy
331
311
msgid ""
332
312
"Since the ratio is exact, it can be used to losslessly recreate the original "
333
313
"value:"
334
314
msgstr ""
335
- "由於該比率是精準的,它可無損地再現該原始值:\n"
336
- "\n"
337
- "::"
315
+ "由於該比率是精準的,它可無損地再現該原始值:"
338
316
339
317
#: ../../tutorial/floatingpoint.rst:200
340
- #, fuzzy
341
318
msgid ""
342
319
"The :meth:`float.hex` method expresses a float in hexadecimal (base 16), "
343
320
"again giving the exact value stored by your computer:"
344
321
msgstr ""
345
322
":meth:`float.hex` method 以十六進位(基數為 16)表示 float,一樣可以給出你的"
346
- "電腦所儲存的精準值:\n"
347
- "\n"
348
- "::"
323
+ "電腦所儲存的精準值:"
349
324
350
325
#: ../../tutorial/floatingpoint.rst:208
351
- #, fuzzy
352
326
msgid ""
353
327
"This precise hexadecimal representation can be used to reconstruct the float "
354
328
"value exactly:"
355
- msgstr ""
356
- "這種精確的十六進位表示法可用於精準地重建 float 值:\n"
357
- "\n"
358
- "::"
329
+ msgstr "這種精確的十六進位表示法可用於精準地重建 float 值:"
359
330
360
331
#: ../../tutorial/floatingpoint.rst:216
361
332
msgid ""
@@ -443,36 +414,26 @@ msgstr ""
443
414
"::"
444
415
445
416
#: ../../tutorial/floatingpoint.rst:286
446
- #, fuzzy
447
417
msgid ""
448
418
"and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< "
449
419
"2**53``), the best value for *N* is 56:"
450
420
msgstr ""
451
421
"而前面提到 *J* 有精準的 53 位元(即 ``>= 2**52`` 但 ``< 2**53``),所以 *N* "
452
- "的最佳數值是 56:\n"
453
- "\n"
454
- "::"
422
+ "的最佳數值是 56:"
455
423
456
424
#: ../../tutorial/floatingpoint.rst:294
457
- #, fuzzy
458
425
msgid ""
459
426
"That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. "
460
427
"The best possible value for *J* is then that quotient rounded:"
461
428
msgstr ""
462
429
"意即,要使 *J* 正好有 53 位元,則 56 會是 *N* 的唯一值。而 *J* 最有可能的數值"
463
- "就是經過捨入後的該商數:\n"
464
- "\n"
465
- "::"
430
+ "就是經過捨入後的該商數:"
466
431
467
432
#: ../../tutorial/floatingpoint.rst:303
468
- #, fuzzy
469
433
msgid ""
470
434
"Since the remainder is more than half of 10, the best approximation is "
471
435
"obtained by rounding up:"
472
- msgstr ""
473
- "由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:\n"
474
- "\n"
475
- "::"
436
+ msgstr "由於餘數超過 10 的一半,所以最佳的近似值是透過進位而得:"
476
437
477
438
#: ../../tutorial/floatingpoint.rst:313
478
439
msgid ""
@@ -511,17 +472,12 @@ msgstr ""
511
472
"::"
512
473
513
474
#: ../../tutorial/floatingpoint.rst:334
514
- #, fuzzy
515
475
msgid ""
516
476
"If we multiply that fraction by 10\\ *\\ *55, we can see the value out to 55 "
517
477
"decimal digits:"
518
- msgstr ""
519
- "如果將該分數乘以 10\\ *\\ *55,則可以看到該值以 55 個十進位數字顯示:\n"
520
- "\n"
521
- "::"
478
+ msgstr "如果將該分數乘以 10\\ *\\ *55,則可以看到該值以 55 個十進位數字顯示:"
522
479
523
480
#: ../../tutorial/floatingpoint.rst:342
524
- #, fuzzy
525
481
msgid ""
526
482
"meaning that the exact number stored in the computer is equal to the decimal "
527
483
"value 0.1000000000000000055511151231257827021181583404541015625. Instead of "
@@ -530,32 +486,9 @@ msgid ""
530
486
msgstr ""
531
487
"這表示儲存在電腦中的精準數值等於十進位值 "
532
488
"0.1000000000000000055511151231257827021181583404541015625。與其顯示完整的十進"
533
- "位數值,許多語言(包括 Python 的舊版本)選擇將結果捨入至 17 個有效位數:\n"
534
- "\n"
535
- "::"
489
+ "位數值,許多語言(包括 Python 的舊版本)選擇將結果捨入至 17 個有效位數:"
536
490
537
491
#: ../../tutorial/floatingpoint.rst:352
538
- #, fuzzy
539
492
msgid ""
540
493
"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` 模組能使這些計算變得容易:"