aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/javascript/reference/global_objects/number/negative_infinity
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 14:46:50 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 14:46:50 +0100
commita55b575e8089ee6cab7c5c262a7e6db55d0e34d6 (patch)
tree5032e6779a402a863654c9d65965073f09ea4182 /files/es/web/javascript/reference/global_objects/number/negative_infinity
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-a55b575e8089ee6cab7c5c262a7e6db55d0e34d6.tar.gz
translated-content-a55b575e8089ee6cab7c5c262a7e6db55d0e34d6.tar.bz2
translated-content-a55b575e8089ee6cab7c5c262a7e6db55d0e34d6.zip
unslug es: move
Diffstat (limited to 'files/es/web/javascript/reference/global_objects/number/negative_infinity')
-rw-r--r--files/es/web/javascript/reference/global_objects/number/negative_infinity/index.html117
1 files changed, 117 insertions, 0 deletions
diff --git a/files/es/web/javascript/reference/global_objects/number/negative_infinity/index.html b/files/es/web/javascript/reference/global_objects/number/negative_infinity/index.html
new file mode 100644
index 0000000000..2e2d7d1573
--- /dev/null
+++ b/files/es/web/javascript/reference/global_objects/number/negative_infinity/index.html
@@ -0,0 +1,117 @@
+---
+title: Number.NEGATIVE_INFINITY
+slug: Web/JavaScript/Referencia/Objetos_globales/Number/NEGATIVE_INFINITY
+tags:
+ - JavaScript
+ - Number
+ - Property
+translation_of: Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY
+---
+<div>
+ {{JSRef("Objetos_globales", "Number")}}</div>
+<h2 id="Summary" name="Summary">Resumen</h2>
+<p>La propiedad <code><strong>Number.NEGATIVE_INFINITY</strong></code> representa el valor del infinito negativo.</p>
+<p>No se tiene que crear un objeto {{jsxref("Number")}} para acceder a esta propiedad estática (use <code>Number.NEGATIVE_INFINITY</code>).</p>
+<p>{{js_property_attributes(0,0,0)}}</p>
+<h2 id="Description" name="Description">Descripción</h2>
+<p>El valor <code>Number.NEGATIVE_INFINITY</code> es el mismo que el valor negativo de la propiedad del objeto global {{jsxref( "Infinity")}}<strong><code>.</code></strong></p>
+<p>Este valor tiene un comportamiento ligeramente diferente que el del infinito matematico:</p>
+<ul>
+ <li>Cualquier valor positivo, incluyendo <code>POSITIVE_INFINITY</code>, multiplicado por <code>NEGATIVE_INFINITY</code> da como resultado <code>NEGATIVE_INFINITY</code>.</li>
+ <li>Cualquier valor negativo, incluyendo <code>NEGATIVE_INFINITY</code>, multiplicado por <code>NEGATIVE_INFINITY</code> da como resultado <code>POSITIVE_INFINITY</code>.</li>
+ <li>Cero multiplicado por <code>NEGATIVE_INFINITY</code> da como resultado <code>NaN</code>.</li>
+ <li>NaN multiplicado por <code>NEGATIVE_INFINITY</code> da como resultado  <code>NaN</code>.</li>
+ <li><code>NEGATIVE_INFINITY</code>, divido por cualquier valor negativo excepto <code>NEGATIVE_INFINITY</code>, da como resultado <code>POSITIVE_INFINITY</code>.</li>
+ <li><code>NEGATIVE_INFINITY</code>, divido por cualquier valor positivo excepto <code>POSITIVE_INFINITY</code>, da como resultado <code>NEGATIVE_INFINITY</code>.</li>
+ <li><code>NEGATIVE_INFINITY</code>, divido por <code>NEGATIVE_INFINITY</code> o por <code>POSITIVE_INFINITY</code>, da como resultado <code>NaN</code>.</li>
+ <li>Cualquier numero divido por <code>NEGATIVE_INFINITY</code> da como resultado cero.</li>
+</ul>
+<p>Muchos métodos JavaScript (tales como el constructor del objeto <code>Number</code>, <code>parseFloat</code>, y <code>parseInt</code>) retornan <code>NaN</code> si el valor especifico en el párametro es significativamente menor a <code>Number.MIN_VALUE</code>.</p>
+<p>Podrías utilizar la propiedad <code>Number.NEGATIVE_INFINITY</code> para indicar una condición de error que retorne un numero finito en caso de que esto suceda. Note, sin embargo, que <code><a href="/es/docs/Referencia_de_JavaScript_1.5/Funciones_globales/isFinite">isFinite</a></code> seria mas apropiado en estos casos.</p>
+<h2 id="Example" name="Example">Example</h2>
+<p>En el siguiente ejemplo, a la variable <code>smallNumber </code>se le asigna un valor mucho mas pequeño al valor minimo. Cuando la sentencia <code>if</code> es ejecutada, <code>smallNumber </code>tiene el valor "<code>-Infinity</code>", por lo cual a <code>smallNumber </code>le es asignado un valor finito mas manejable antes de continuar.</p>
+<pre class="brush:js">var smallNumber = (-Number.MAX_VALUE) * 2
+
+if (smallNumber === Number.NEGATIVE_INFINITY) {
+ smallNumber = returnFinite();
+}
+</pre>
+<h2 id="Especificaciones">Especificaciones</h2>
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificaciones</th>
+ <th scope="col">Estado</th>
+ <th scope="col">Comentario</th>
+ </tr>
+ <tr>
+ <td>ECMAScript 1ra Edición. Implementado en JavaScript 1.1</td>
+ <td>Estándar</td>
+ <td>Definición inicial.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.7.3.5', 'Number.NEGATIVE_INFINITY')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-number.negative_infinity', 'Number.NEGATIVE_INFINITY')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2>
+<p>{{ CompatibilityTable() }}</p>
+<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>Soporte básico</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</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>Soporte básico</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ <td>(Si)</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+<h2 id="See_also" name="See_also">Ver también</h2>
+<ul>
+ <li>{{jsxref("Number.POSITIVE_INFINITY")}}</li>
+ <li>{{jsxref( "Infinity")}}</li>
+ <li>{{jsxref("isFinite")}}</li>
+</ul>