From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- .../reference/global_objects/math/abs/index.html | 130 --------------------- 1 file changed, 130 deletions(-) delete mode 100644 files/ca/web/javascript/reference/global_objects/math/abs/index.html (limited to 'files/ca/web/javascript/reference/global_objects/math/abs') diff --git a/files/ca/web/javascript/reference/global_objects/math/abs/index.html b/files/ca/web/javascript/reference/global_objects/math/abs/index.html deleted file mode 100644 index db78802c1f..0000000000 --- a/files/ca/web/javascript/reference/global_objects/math/abs/index.html +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: Math.abs() -slug: Web/JavaScript/Reference/Global_Objects/Math/abs -translation_of: Web/JavaScript/Reference/Global_Objects/Math/abs -original_slug: Web/JavaScript/Referencia/Objectes_globals/Math/abs ---- -
{{JSRef("Global_Objects", "Math")}}
- -

Resum

- -

La funció Math.abs() retorna el valor absolut d'un nombre. És a dir:

- -

Math.abs(x)=|x|={xifx>00ifx=0-xifx<0{\mathtt{\operatorname{Math.abs}(x)}} = {|x|} = \begin{cases} x & \text{if} \quad x \geq 0 \\ -x & \text{if} \quad x < 0 \end{cases}

- -

Sintaxi

- -
Math.abs(x)
- -

Paràmetres

- -
-
x
-
Un nombre.
-
- -

Descripció

- -

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

- -

Exemples

- -

Exemple: Comportament de Math.abs()

- -

Si li passem una string no numèric o bé una variable {{jsxref("undefined")}}/buida retorna {{jsxref("NaN")}}. Passar {{jsxref("null")}} retorna 0.

- -
Math.abs('-1');     // 1
-Math.abs(-2);       // 2
-Math.abs(null);     // 0
-Math.abs('string'); // NaN
-Math.abs();         // NaN
-
- -

Especificacions

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