From cb9e359a51c3249d8f5157db69d43fd413ddeda6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:45:12 +0100 Subject: unslug ca: move --- .../reference/global_objects/math/cbrt/index.html | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/math/cbrt/index.html (limited to 'files/ca/web/javascript/reference/global_objects/math/cbrt') diff --git a/files/ca/web/javascript/reference/global_objects/math/cbrt/index.html b/files/ca/web/javascript/reference/global_objects/math/cbrt/index.html new file mode 100644 index 0000000000..70d6767183 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/math/cbrt/index.html @@ -0,0 +1,122 @@ +--- +title: Math.cbrt() +slug: Web/JavaScript/Referencia/Objectes_globals/Math/cbrt +translation_of: Web/JavaScript/Reference/Global_Objects/Math/cbrt +--- +
{{JSRef}}
+ +

La funció Math.cbrt() retorna la rel cúbica d'un nombre, és a dir

+ +

Math.cbrt(x)=x3=la únicaytal quey3=x\mathtt{Math.cbrt(x)} = \sqrt[3]{x} = \text{the unique} \; y \; \text{such that} \; y^3 = x

+ +

Sintaxi

+ +
Math.cbrt(x)
+ +

Paràmetres

+ +
+
x
+
Un nombre.
+
+ +

Descripció

+ +

Degut a que cbrt() és un mètode estàtic de Math, sempre s'utilitza com a Math.cbrt(), en comptes de com a mètode d'una instància de Math (Math no és un constructor).

+ +

Exemples

+ +

Utilitzar Math.cbrt()

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

Polyfill

+ +

Per a tot x0x \geq 0, tenim que x3=x1/3\sqrt[3]{x} = x^{1/3} , podem llavors emular aquest comportament amb la funció següent:

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

Especificacions

+ + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES6', '#sec-math.cbrt', 'Math.cbrt')}}{{Spec2('ES6')}}Definició inicial.
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatChrome("38")}}{{CompatGeckoDesktop("25")}}{{CompatNo}}{{CompatOpera("25")}}{{CompatSafari("7.1")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatNo}}{{CompatNo}}{{CompatGeckoMobile("25")}}{{CompatNo}}{{CompatNo}}8
+
+ +

Vegeu també

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