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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
---
title: Number.MAX_VALUE
slug: Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE
tags:
- JavaScript
- Number
- Property
translation_of: Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE
---
<div>{{JSRef}}</div>
<p>Die <strong><code>Number.MAX_VALUE</code></strong> Eigenschaft repräsentiert den größten nummerische Wert, der in JavaScript repräsentiert werden kann.</p>
<div>{{EmbedInteractiveExample("pages/js/number-maxvalue.html")}}</div>
<div>{{js_property_attributes(0, 0, 0)}}</div>
<h2 id="Beschreibung">Beschreibung</h2>
<p>Die <code>MAX_VALUE</code> Eigenschaft hat einen ungefähren Wert von <code>1.79E+308</code> (<math><semantics><mrow><mn>1</mn><mo>,</mo><mn>79</mn><mo>⋅</mo><msup><mn>10</mn><mn>308</mn></msup></mrow><annotation encoding="TeX">1,79 \cdot 10^{308}</annotation></semantics></math>). Werte die größer sind, werden als "<code>Infinity</code>" (unendlich) repräsentiert.</p>
<p>Weil <code>MAX_VALUE</code> eine statische Eigenschaft von {{jsxref("Number")}} ist, wird sie immer mit <code>Number.</code> <code>MAX_VALUE</code> abgerufen, im Gegensatz zu einer Eigenschaft eines {{jsxref("Number")}} Objektes, was erstellt wurde.</p>
<h2 id="Beispiele">Beispiele</h2>
<h3 id="Einsatz_von_MAX_VALUE">Einsatz von <code>MAX_VALUE</code></h3>
<p>Im folgenden Quelltext werden zwei nummerische Werte multipliziert. Wenn das Ergebnis kleiner oder gleich <code>MAX_VALUE</code> ist, wird <code>func1()</code> ausgeführt; andernfalls wird <code>func2() </code>ausgeführt. </p>
<pre class="brush: js">if (num1 * num2 <= Number.MAX_VALUE) {
func1();
} else {
func2();
}
</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('ES1')}}</td>
<td>{{Spec2('ES1')}}</td>
<td>Initiale Definition. Implementiert in JavaScript 1.1.</td>
</tr>
<tr>
<td>{{SpecName('ES5.1', '#sec-15.7.3.2', 'Number.MAX_VALUE')}}</td>
<td>{{Spec2('ES5.1')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ES6', '#sec-number.max_value', 'Number.MAX_VALUE')}}</td>
<td>{{Spec2('ES6')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('ESDraft', '#sec-number.max_value', 'Number.MAX_VALUE')}}</td>
<td>{{Spec2('ESDraft')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
<p>{{Compat("javascript.builtins.Number.MAX_VALUE")}}</p>
<h2 id="Siehe_auch">Siehe auch</h2>
<ul>
<li>{{jsxref("Number.MIN_VALUE")}}</li>
<li>{{jsxref("Number")}}</li>
</ul>
|