blob: ceb2bc0e911c13abb370c49e74b4a34ad5ea8a7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
---
title: Number.MIN_SAFE_INTEGER
slug: Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER
tags:
- ECMAScript 2015
- JavaScript
- Number
- Property
translation_of: Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER
---
<div>{{JSRef}}</div>
<p>Die <code><strong>Number.MIN_SAFE_INTEGER</strong></code> Konstante repräsentiert die kleinste sicheren ganze Zahl in JavaScript (<code>-(2<sup>53</sup> - 1)</code>).</p>
<div>{{EmbedInteractiveExample("pages/js/number-min-safe-integer.html")}}</div>
<div>{{js_property_attributes(0, 0, 0)}}</div>
<h2 id="Beschreibung">Beschreibung</h2>
<p>Die <code>MIN_SAFE_INTEGER</code> Konstante hat einen Wert von <code>-</code> <code>9007199254740991</code> (-9.007.199.254.740.991 oder ca. -9 <span class="short_text" id="result_box" lang="de"><span>Billiarde</span></span>). Die Bedeutung hinter dieser Zahl ist, dass in JavaScript <a class="external external-icon" href="http://en.wikipedia.org/wiki/Double_precision_floating-point_format">double-precision floating-point Zahlen</a> wie sie in <a class="external external-icon" href="http://en.wikipedia.org/wiki/IEEE_floating_point">IEEE 754</a> spezifiziert sind benutzt werden. Nach dieser Spezifikation ist die sichere Repräsentation von Zahlen nur zwischen <code>-(2<sup>53</sup> - 1)</code> und <code>2<sup>53</sup> - 1</code> möglich. Für mehr details Siehe im Artikel {{jsxref("Number.isSafeInteger()")}} nach.</p>
<p>Weil <code>MIN_SAFE_INTEGER</code> eine statische Eigenschaft von {{jsxref("Number")}} ist, wird sie immer mit <code>Number.MIN_SAFE_INTEGER</code> abgerufen, im Gegensatz zu einer Eigenschaft eines {{jsxref("Number")}} Objektes, was erstellt wurde.</p>
<h2 id="Beispiele">Beispiele</h2>
<pre class="brush: js">Number.MIN_SAFE_INTEGER // -9007199254740991
-(Math.pow(2, 53) - 1) // -9007199254740991
</pre>
<h2 id="Spezifikationen">Spezifikationen</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spezifikation</th>
<th scope="col">Status</th>
<th scope="col">Kommentar</th>
</tr>
<tr>
<td>{{SpecName('ES2015', '#sec-number.min_safe_integer', 'Number.MIN_SAFE_INTEGER')}}</td>
<td>{{Spec2('ES2015')}}</td>
<td>Initiale Definition.</td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-number.min_safe_integer', 'Number.MIN_SAFE_INTEGER')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
<p>{{Compat("javascript.builtins.Number.MIN_SAFE_INTEGER")}}</p>
<h2 id="Siehe_auch">Siehe auch</h2>
<ul>
<li>{{jsxref("Number.MAX_SAFE_INTEGER")}}</li>
<li>{{jsxref("Number.isSafeInteger()")}}</li>
</ul>
|