aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/javascript/reference/global_objects/math/sign/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ca/web/javascript/reference/global_objects/math/sign/index.html')
-rw-r--r--files/ca/web/javascript/reference/global_objects/math/sign/index.html132
1 files changed, 0 insertions, 132 deletions
diff --git a/files/ca/web/javascript/reference/global_objects/math/sign/index.html b/files/ca/web/javascript/reference/global_objects/math/sign/index.html
deleted file mode 100644
index a3a1df277e..0000000000
--- a/files/ca/web/javascript/reference/global_objects/math/sign/index.html
+++ /dev/null
@@ -1,132 +0,0 @@
----
-title: Math.sign()
-slug: Web/JavaScript/Reference/Global_Objects/Math/sign
-translation_of: Web/JavaScript/Reference/Global_Objects/Math/sign
-original_slug: Web/JavaScript/Referencia/Objectes_globals/Math/sign
----
-<div>{{JSRef}}</div>
-
-<p>La funció <strong><code>Math.sign()</code></strong> retorna el signe d'un nombre, indicant si el nombre donat és positiu, negatiu o zero.</p>
-
-<h2 id="Sintaxi">Sintaxi</h2>
-
-<pre class="syntaxbox"><code>Math.sign(<var>x</var>)</code></pre>
-
-<h3 id="Paràmetres">Paràmetres</h3>
-
-<dl>
- <dt><code>x</code></dt>
- <dd>Un nombre.</dd>
-</dl>
-
-<h2 id="Descripció">Descripció</h2>
-
-<p>Com que <code>sign()</code> és un mètode estàtic de <code>Math</code>, sempre s'utilitza com <code>Math.sign()</code> en comptes de com un mètode d'un objecte <code>Math</code> creat (<code>Math</code> no és un constructor).</p>
-
-<p>Aquesta funció pot retornar 5 valors diferents,<code> 1</code>, <code>-1</code>, <code>0</code>, <code>-0</code>, <code>NaN</code>, que representen "nombre positiu", "nombre negatiu", "zero positiu", "zero negatiu" i {{jsxref("NaN")}} respectivament.</p>
-
-<p>L'argument passat a aquesta funció serà convertit al tipus de <code>x</code> implícitament.</p>
-
-<h2 id="Exemples">Exemples</h2>
-
-<h3 id="Utilitzar_Math.sign()">Utilitzar <code>Math.sign()</code></h3>
-
-<pre class="brush: js">Math.sign(3); // 1
-Math.sign(-3); // -1
-Math.sign('-3'); // -1
-Math.sign(0); // 0
-Math.sign(-0); // -0
-Math.sign(NaN); // NaN
-Math.sign('foo'); // NaN
-Math.sign(); // NaN
-</pre>
-
-<h2 id="Polyfill">Polyfill</h2>
-
-<pre class="brush: js">Math.sign = Math.sign || function(x) {
- x = +x; // converteix a un nombre
- if (x === 0 || isNaN(x)) {
- return x;
- }
- return x &gt; 0 ? 1 : -1;
-}
-</pre>
-
-<h2 id="Especificacions">Especificacions</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Especificació</th>
- <th scope="col">Estat</th>
- <th scope="col">Comentaris</th>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-math.sign', 'Math.sign')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td>Definició inicial.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Característica</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Suport bàsic</td>
- <td>{{CompatChrome("38")}}</td>
- <td>{{CompatGeckoDesktop("25")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatOpera("25")}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Característica</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Suport bàsic</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatGeckoMobile("25")}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- <td>{{CompatNo}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="Vegeu_també">Vegeu també</h2>
-
-<ul>
- <li>{{jsxref("Math.abs()")}}</li>
- <li>{{jsxref("Math.ceil()")}}</li>
- <li>{{jsxref("Math.floor()")}}</li>
- <li>{{jsxref("Math.round()")}}</li>
- <li>{{jsxref("Math.trunc()")}} {{experimental_inline}}</li>
-</ul>