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

Resum

+ +

La propietat Math.PI representa el ratio entre la circumferència d'un crecle i el seu diàmetre, el seu valor aproximat és de 3.14159:

+ +

Math.PI=π3.14159\mathtt{\mi{Math.PI}} = \pi \approx 3.14159

+ +
{{js_property_attributes(0, 0, 0)}}
+ +

Descripció

+ +

Com que PI és una propietat estàtica de Math, sempre s'utilitza amb la forma Math.PI, ren comptes de com una propietat d'un objecte Math ja creat (Math on és un constructor).

+ +

Exemples

+ +

Exemple: Utilitzar Math.PI

+ +

La funció següent utilitza Math.PI per a calcular la circumferència d'un cercle a partir del radi que rep.

+ +
function calculateCircumference(radius) {
+  return 2 * Math.PI * radius;
+}
+
+calculateCircumference(1);  // 6.283185307179586
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
ECMAScript 1a Edició.StandardDefinició inicial. Implementat a JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.1.6', 'Math.PI')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.pi', 'Math.PI')}}{{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