@@ -12,7 +12,7 @@ msgid ""
1212msgstr ""
1313"Project-Id-Version : Python 3.13\n "
1414"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2024-10-04 14:17+0000\n "
15+ "POT-Creation-Date : 2024-10-18 14:17+0000\n "
1616"PO-Revision-Date : 2021-06-28 01:50+0000\n "
1717"
Last-Translator :
Maciej Olko <[email protected] >, 2024\n "
1818"Language-Team : Polish (https://app.transifex.com/python-doc/teams/5390/pl/)\n "
@@ -210,6 +210,14 @@ msgid ""
210210">>> repr(math.pi)\n"
211211"'3.141592653589793'"
212212msgstr ""
213+ ">>> format(math.pi, '.12g') # daj 12 znaczących cyfr\n"
214+ "'3.14159265359'\n"
215+ "\n"
216+ ">>> format(math.pi, '.2f') # daj 2 cyfry po kropce\n"
217+ "'3.14'\n"
218+ "\n"
219+ ">>> repr(math.pi)\n"
220+ "'3.141592653589793'"
213221
214222msgid ""
215223"It's important to realize that this is, in a real sense, an illusion: you're "
@@ -229,6 +237,8 @@ msgid ""
229237">>> 0.1 + 0.1 + 0.1 == 0.3\n"
230238"False"
231239msgstr ""
240+ ">>> 0.1 + 0.1 + 0.1 == 0.3\n"
241+ "False"
232242
233243msgid ""
234244"Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 "
@@ -243,6 +253,8 @@ msgid ""
243253">>> round(0.1, 1) + round(0.1, 1) + round(0.1, 1) == round(0.3, 1)\n"
244254"False"
245255msgstr ""
256+ ">>> round(0.1, 1) + round(0.1, 1) + round(0.1, 1) == round(0.3, 1)\n"
257+ "False"
246258
247259msgid ""
248260"Though the numbers cannot be made closer to their intended exact values, "
@@ -256,6 +268,8 @@ msgid ""
256268">>> math.isclose(0.1 + 0.1 + 0.1, 0.3)\n"
257269"True"
258270msgstr ""
271+ ">>> math.isclose(0.1 + 0.1 + 0.1, 0.3)\n"
272+ "True"
259273
260274msgid ""
261275"Alternatively, the :func:`round` function can be used to compare rough "
@@ -268,6 +282,8 @@ msgid ""
268282">>> round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)\n"
269283"True"
270284msgstr ""
285+ ">>> round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)\n"
286+ "True"
271287
272288msgid ""
273289"Binary floating-point arithmetic holds many surprises like this. The "
@@ -361,6 +377,9 @@ msgid ""
361377">>> x.as_integer_ratio()\n"
362378"(3537115888337719, 1125899906842624)"
363379msgstr ""
380+ ">>> x = 3.14159\n"
381+ ">>> x.as_integer_ratio()\n"
382+ "(3537115888337719, 1125899906842624)"
364383
365384msgid ""
366385"Since the ratio is exact, it can be used to losslessly recreate the original "
@@ -373,6 +392,8 @@ msgid ""
373392">>> x == 3537115888337719 / 1125899906842624\n"
374393"True"
375394msgstr ""
395+ ">>> x == 3537115888337719 / 1125899906842624\n"
396+ "True"
376397
377398msgid ""
378399"The :meth:`float.hex` method expresses a float in hexadecimal (base 16), "
@@ -386,6 +407,8 @@ msgid ""
386407">>> x.hex()\n"
387408"'0x1.921f9f01b866ep+1'"
388409msgstr ""
410+ ">>> x.hex()\n"
411+ "'0x1.921f9f01b866ep+1'"
389412
390413msgid ""
391414"This precise hexadecimal representation can be used to reconstruct the float "
@@ -398,6 +421,8 @@ msgid ""
398421">>> x == float.fromhex('0x1.921f9f01b866ep+1')\n"
399422"True"
400423msgstr ""
424+ ">>> x == float.fromhex('0x1.921f9f01b866ep+1')\n"
425+ "True"
401426
402427msgid ""
403428"Since the representation is exact, it is useful for reliably porting values "
@@ -429,6 +454,10 @@ msgid ""
429454">>> sum([0.1] * 10) == 1.0\n"
430455"True"
431456msgstr ""
457+ ">>> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 == 1.0\n"
458+ "False\n"
459+ ">>> sum([0.1] * 10) == 1.0\n"
460+ "True"
432461
433462msgid ""
434463"The :func:`math.fsum` goes further and tracks all of the \" lost digits\" as "
@@ -502,13 +531,13 @@ msgstr ""
502531"dokładnie 53 bity. Zapisując ::"
503532
504533msgid "1 / 10 ~= J / (2**N)"
505- msgstr ""
534+ msgstr "1 / 10 ~= J / (2**N) "
506535
507536msgid "as ::"
508537msgstr "jako ::"
509538
510539msgid "J ~= 2**N / 10"
511- msgstr ""
540+ msgstr "J ~= 2**N / 10 "
512541
513542msgid ""
514543"and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< "
@@ -521,6 +550,8 @@ msgid ""
521550">>> 2**52 <= 2**56 // 10 < 2**53\n"
522551"True"
523552msgstr ""
553+ ">>> 2**52 <= 2**56 // 10 < 2**53\n"
554+ "True"
524555
525556msgid ""
526557"That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. "
@@ -535,6 +566,9 @@ msgid ""
535566">>> r\n"
536567"6"
537568msgstr ""
569+ ">>> q, r = divmod(2**56, 10)\n"
570+ ">>> r\n"
571+ "6"
538572
539573msgid ""
540574"Since the remainder is more than half of 10, the best approximation is "
@@ -547,6 +581,8 @@ msgid ""
547581">>> q+1\n"
548582"7205759403792794"
549583msgstr ""
584+ ">>> q+1\n"
585+ "7205759403792794"
550586
551587msgid ""
552588"Therefore the best possible approximation to 1/10 in IEEE 754 double "
@@ -556,14 +592,14 @@ msgstr ""
556592"precyzji typu IEEE 754 jest::"
557593
558594msgid "7205759403792794 / 2 ** 56"
559- msgstr ""
595+ msgstr "7205759403792794 / 2 ** 56 "
560596
561597msgid ""
562598"Dividing both the numerator and denominator by two reduces the fraction to::"
563599msgstr "Podzielenie licznika i mianownika przez dwa zmniejsza ułamek do::"
564600
565601msgid "3602879701896397 / 2 ** 55"
566- msgstr ""
602+ msgstr "3602879701896397 / 2 ** 55 "
567603
568604msgid ""
569605"Note that since we rounded up, this is actually a little bit larger than "
@@ -586,6 +622,8 @@ msgid ""
586622">>> 0.1 * 2 ** 55\n"
587623"3602879701896397.0"
588624msgstr ""
625+ ">>> 0.1 * 2 ** 55\n"
626+ "3602879701896397.0"
589627
590628msgid ""
591629"If we multiply that fraction by 10\\ *\\ *55, we can see the value out to 55 "
@@ -598,6 +636,8 @@ msgid ""
598636">>> 3602879701896397 * 10 ** 55 // 2 ** 55\n"
599637"1000000000000000055511151231257827021181583404541015625"
600638msgstr ""
639+ ">>> 3602879701896397 * 10 ** 55 // 2 ** 55\n"
640+ "1000000000000000055511151231257827021181583404541015625"
601641
602642msgid ""
603643"meaning that the exact number stored in the computer is equal to the decimal "
@@ -614,6 +654,8 @@ msgid ""
614654">>> format(0.1, '.17f')\n"
615655"'0.10000000000000001'"
616656msgstr ""
657+ ">>> format(0.1, '.17f')\n"
658+ "'0.10000000000000001'"
617659
618660msgid ""
619661"The :mod:`fractions` and :mod:`decimal` modules make these calculations easy:"
@@ -636,3 +678,17 @@ msgid ""
636678">>> format(Decimal.from_float(0.1), '.17')\n"
637679"'0.10000000000000001'"
638680msgstr ""
681+ ">>> from decimal import Decimal\n"
682+ ">>> from fractions import Fraction\n"
683+ "\n"
684+ ">>> Fraction.from_float(0.1)\n"
685+ "Fraction(3602879701896397, 36028797018963968)\n"
686+ "\n"
687+ ">>> (0.1).as_integer_ratio()\n"
688+ "(3602879701896397, 36028797018963968)\n"
689+ "\n"
690+ ">>> Decimal.from_float(0.1)\n"
691+ "Decimal('0.1000000000000000055511151231257827021181583404541015625')\n"
692+ "\n"
693+ ">>> format(Decimal.from_float(0.1), '.17')\n"
694+ "'0.10000000000000001'"
0 commit comments