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/pow/index.html | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 files/ca/web/javascript/reference/global_objects/math/pow/index.html (limited to 'files/ca/web/javascript/reference/global_objects/math/pow') diff --git a/files/ca/web/javascript/reference/global_objects/math/pow/index.html b/files/ca/web/javascript/reference/global_objects/math/pow/index.html new file mode 100644 index 0000000000..efe89000e9 --- /dev/null +++ b/files/ca/web/javascript/reference/global_objects/math/pow/index.html @@ -0,0 +1,140 @@ +--- +title: Math.pow() +slug: Web/JavaScript/Referencia/Objectes_globals/Math/pow +translation_of: Web/JavaScript/Reference/Global_Objects/Math/pow +--- +
{{JSRef}}
+ +

La funció Math.pow() retorna la base elevada a exponent, és a dir, baseexponent.

+ +

Sintaxi

+ +
Math.pow(base, exponent)
+ +

Paràmetres

+ +
+
base
+
El nombre base.
+
exponent
+
L'exponent que s'usarà per a elevar la base.
+
+ +

Descripció

+ +

Com que pow() és un mètode estàtic de Math, sempre s'utilitza com Math.pow() en comptes de com un mètode d'un objecte Math creat (Math no és un constructor).

+ +

Exemples

+ +

Utilitzar Math.pow()

+ +
// simple
+Math.pow(7, 2);    // 49
+Math.pow(7, 3);    // 343
+Math.pow(2, 10);   // 1024
+// exponents fractionals
+Math.pow(4, 0.5);  // 2 (rel quadrada de 4)
+Math.pow(8, 1/3);  // 2 (rel cúbica de 8)
+Math.pow(2, 0.5);  // 1.412135623730951 (rel quadrada de 2)
+Math.pow(2, 1/3);  // 1.2599210498948732 (rel cúbica de 2)
+// exponents amb signe
+Math.pow(7, -2);   // 0.02040816326530612 (1/49)
+Math.pow(8, -1/3); // 0.5
+// bases amb signe
+Math.pow(-7, 2);   // 49 (qualsevol nombre elevat al quadrat és positiu)
+Math.pow(-7, 3);   // -343 (nombres elevats al cub poden ser negatius)
+Math.pow(-7, 0.5); // NaN (els nombres negatius no tenen una rel quadrada real)
+// degut a rels "parells" i "senars" estan aprox l'una de l'altra
+// i a límits en la precisió dels nombres de punt flotant,
+// bases negatives amb exponents fraccionals sempre retornen NaN
+Math.pow(-7, 1/3); // NaN
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
{{SpecName('ES1')}}{{Spec2('ES1')}}Definició inicial. Implementat a JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.2.13', 'Math.pow')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.pow', 'Math.pow')}}{{Spec2('ES6')}} 
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

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