You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/05-types/article.md
+5-10Lines changed: 5 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -70,25 +70,20 @@ O práci s čísly si povíme víc v kapitole <info:number>.
70
70
## BigInt [#bigint-type]
71
71
72
72
<<<<<<<HEAD
73
-
Typ „číslo“ v JavaScriptu nedokáže reprezentovat celočíselné hodnoty větší než <code>(2<sup>53</sup>-1)</code> (což je `9007199254740991`), nebo záporné hodnoty nižší než <code>-(-2<sup>53</sup>-1)</code>.Toto technické omezení je dáno jeho vnitřní reprezentací.
73
+
Typ „číslo“ v JavaScriptu nedokáže reprezentovat celočíselné hodnoty větší než <code>(2<sup>53</sup>-1)</code> (což je `9007199254740991`), nebo záporné hodnoty nižší než <code>-(-2<sup>53</sup>-1)</code>.
74
74
75
-
Pro většinu účelů to stačí, ale někdy potřebujeme opravdu velká čísla, např. pro kryptografii nebo časová razítka s přesností na mikrosekundy.
76
-
=======
77
-
In JavaScript, the "number" type cannot safely represent integer values larger than <code>(2<sup>53</sup>-1)</code> (that's `9007199254740991`), or less than <code>-(2<sup>53</sup>-1)</code> for negatives.
75
+
Abychom byli opravdu přesní, typ `číslo` umí ukládat větší celá čísla (až do<code>1.7976931348623157*10<sup>308</sup></code>), ale mimo bezpečného celočíselného intervalu <code>±(2<sup>53</sup>-1)</code> nastane chyba přesnosti, jelikož do pevného 64-bitového úložiště se nevejdou všechny číslice. Může být tedy uložena „přibližná“ hodnota.
78
76
79
-
To be really precise, the "number" type can store larger integers (up to <code>1.7976931348623157 * 10<sup>308</sup></code>), but outside of the safe integer range <code>±(2<sup>53</sup>-1)</code> there'll be a precision error, because not all digits fit into the fixed 64-bit storage. So an "approximate" value may be stored.
80
-
81
-
For example, these two numbers (right above the safe range) are the same:
77
+
Například tato dvě čísla (těsně nad bezpečným intervalem) budou stejná:
So to say, all odd integers greater than <code>(2<sup>53</sup>-1)</code> can't be stored at all in the "number" type.
84
+
Dá se tedy říci, že do typu `number` nelze uložit žádné liché celé číslo větší než <code>(2<sup>53</sup>-1)</code>.
89
85
90
-
For most purposes <code>±(2<sup>53</sup>-1)</code> range is quite enough, but sometimes we need the entire range of really big integers, e.g. for cryptography or microsecond-precision timestamps.
91
-
>>>>>>> 82ed8f11b40bd40797427a5dd1763edbe1fca523
86
+
Pro většinu účelů je interval <code>±(2<sup>53</sup>-1)</code> dostačující, ale někdy potřebujeme opravdu velká čísla, např. pro kryptografii nebo časová razítka s přesností na mikrosekundy.
92
87
93
88
Proto byl do jazyka nedávno přidán typ `BigInt`, který představuje celá čísla libovolné délky.
0 commit comments