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 | 95 ---------------------- 1 file changed, 95 deletions(-) delete mode 100644 files/it/web/javascript/reference/global_objects/math/abs/index.html (limited to 'files/it/web/javascript/reference/global_objects/math/abs') diff --git a/files/it/web/javascript/reference/global_objects/math/abs/index.html b/files/it/web/javascript/reference/global_objects/math/abs/index.html deleted file mode 100644 index 6dcf7a7dd6..0000000000 --- a/files/it/web/javascript/reference/global_objects/math/abs/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: Math.abs() -slug: Web/JavaScript/Reference/Global_Objects/Math/abs -translation_of: Web/JavaScript/Reference/Global_Objects/Math/abs ---- -
{{JSRef}}
- -

La funzione Math.abs() ritorna il valore assoluto di un numero, ovvero

- -

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}

- -

Sintassi

- -
Math.abs(x)
- -

Parametri

- -
-
x
-
Un numero.
-
- -

Valore di ritorno

- -

Il valore assoluto del numero passato come parametro.

- -

Descrizione

- -

Siccome abs() è un metodo statico di Math, viene sempre utilizzato come Math.abs() piuttosto che come metodo di un oggetto Math creato in precedenza (Math non è un costruttore).

- -

Esempi

- -

Comportamento di Math.abs()

- -

Passando un oggetto vuoto, un array con più di un elemento, una stringa non numerica o una variabile {{jsxref("undefined")}}/empty il valore di ritorno sarà {{jsxref("NaN")}}. Passando {{jsxref("null")}}, una stringa vuota o un array vuoto, il valore di ritorno sarà 0.

- -
Math.abs('-1');     // 1
-Math.abs(-2);       // 2
-Math.abs(null);     // 0
-Math.abs('');       // 0
-Math.abs([]);       // 0
-Math.abs([2]);      // 2
-Math.abs([1,2]);    // NaN
-Math.abs({});       // NaN
-Math.abs('string'); // NaN
-Math.abs();         // NaN
-
- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('ES1')}}{{Spec2('ES1')}}Definizione iniziale. Implementata in 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')}} 
{{SpecName('ESDraft', '#sec-math.abs', 'Math.abs')}}{{Spec2('ESDraft')}} 
- -

Compatibilità con i Browser

- - - -

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

- -

Vedi anche

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