From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../reference/global_objects/math/cbrt/index.html | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 files/de/web/javascript/reference/global_objects/math/cbrt/index.html (limited to 'files/de/web/javascript/reference/global_objects/math/cbrt') diff --git a/files/de/web/javascript/reference/global_objects/math/cbrt/index.html b/files/de/web/javascript/reference/global_objects/math/cbrt/index.html new file mode 100644 index 0000000000..a24c572eb7 --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/math/cbrt/index.html @@ -0,0 +1,98 @@ +--- +title: Math.cbrt() +slug: Web/JavaScript/Reference/Global_Objects/Math/cbrt +tags: + - JavaScript + - Math + - Method + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Math/cbrt +--- +
{{JSRef}}
+ +

Die Funktion Math.cbrt() gibt die Kubikwurzel einer Zahl zurück:

+ +

Math.cbrt(x)=x3=das  Ergebnisyso  dassy3=x\mathtt{Math.cbrt(x)} = \sqrt[3]{x} = \text{the unique} \; y \; \text{such that} \; y^3 = x

+ +
{{EmbedInteractiveExample("pages/js/math-cbrt.html")}}
+ + + +

Syntax

+ +
Math.cbrt(x)
+ +

Parameter

+ +
+
x
+
Eine Zahl.
+
+ +

Rückgabewert

+ +

Die Kubikwurzel der übergebenen Zahl.

+ +

Beschreibung

+ +

Weil cbrt() eine statische Methode von Math ist, muss diese immer mit Math.cbrt() genutzt werden, ohne dass ein Objekt von Math erstellt wird (Math ist kein Konstruktor).

+ +

Beispiele

+ +

Verwendung von Math.cbrt()

+ +
Math.cbrt(NaN); // NaN
+Math.cbrt(-1); // -1
+Math.cbrt(-0); // -0
+Math.cbrt(-Infinity); // -Infinity
+Math.cbrt(0); // 0
+Math.cbrt(1); // 1
+Math.cbrt(Infinity); // Infinity
+Math.cbrt(null); // 0
+Math.cbrt(2);  // 1.2599210498948734
+ +

Polyfill

+ +

Für x0x \geq 0 gilt x3=x1/3\sqrt[3]{x} = x^{1/3} so dass diese Funktion wie folgt emuliert werden kann:

+ +
if (!Math.cbrt) {
+  Math.cbrt = function(x) {
+    var y = Math.pow(Math.abs(x), 1/3);
+    return x < 0 ? -y : y;
+  };
+}
+ +

Spezifikationen

+ + + + + + + + + + + + + + + + + + + +
SpezifikationStatusKommentar
{{SpecName('ES6', '#sec-math.cbrt', 'Math.cbrt')}}{{Spec2('ES6')}}Initiale Definition.
{{SpecName('ESDraft', '#sec-math.cbrt', 'Math.cbrt')}}{{Spec2('ESDraft')}}
+ +

Browserkompatibilität

+ + + +

{{Compat("javascript.builtins.Math.cbrt")}}

+ +

Siehe auch

+ + -- cgit v1.2.3-54-g00ecf