From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- .../objetos_globales/math/log10/index.html | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 files/es/web/javascript/referencia/objetos_globales/math/log10/index.html (limited to 'files/es/web/javascript/referencia/objetos_globales/math/log10/index.html') diff --git a/files/es/web/javascript/referencia/objetos_globales/math/log10/index.html b/files/es/web/javascript/referencia/objetos_globales/math/log10/index.html new file mode 100644 index 0000000000..dc97208b63 --- /dev/null +++ b/files/es/web/javascript/referencia/objetos_globales/math/log10/index.html @@ -0,0 +1,137 @@ +--- +title: Math.log10() +slug: Web/JavaScript/Referencia/Objetos_globales/Math/log10 +translation_of: Web/JavaScript/Reference/Global_Objects/Math/log10 +--- +
{{JSRef}}
+ +

Math.log10() funcion que retorna el logaritmo de base 10 de un numero, esto es

+ +

x>0,Math.log10(x)=log10(x)=la unicay tal que10y=x\forall x > 0, \mathtt{\operatorname{Math.log10}(x)} = \log_10(x) = \text{the unique} \; y \; \text{such that} \; 10^y = x

+ +

Sintaxis

+ +
Math.log10(x)
+ +

Parametros

+ +
+
x
+
Un Numero
+
+ +

Valor de Retorno

+ +

El logaritmo de base 10 del numero dado. SI el numero es negativo, {{jsxref("NaN")}} es devuelto.

+ +

Descripción

+ +

Si el valor de x es menor que cero, el valor de retorno siempre es {{jsxref("NaN")}}.

+ +

Porque log10() es un metodo estatico de Math, debe usarse siempre Math.log10(), en vez de usarse como un metodo del objeto math que se ha creado (Math no es un constructor).

+ +

Esta función es equivalente de Math.log(x) / Math.log(10).  Para log10(e) use la constante {{jsxref("Math.LOG10E")}} que es 1 / {{jsxref("Math.LN10")}}.  

+ +

Ejemplos

+ +

usando Math.log10()

+ +
Math.log10(2);      // 0.3010299956639812
+Math.log10(1);      // 0
+Math.log10(0);      // -Infinito
+Math.log10(-2);     // NaN
+Math.log10(100000); // 5
+
+ +

Polyfill

+ +

Puede ser emulada con la siguiente función

+ +
Math.log10 = Math.log10 || function(x) {
+  return Math.log(x) * Math.LOG10E;
+};
+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + + + + +
EspecificacionEstadoComentarios
{{SpecName('ES6', '#sec-math.log10', 'Math.log10')}}{{Spec2('ES6')}}Initial definition.
{{SpecName('ESDraft', '#sec-math.log10', 'Math.log10')}}{{Spec2('ESDraft')}} 
+ +

Compatibilidad con Navegadores

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracteristicaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte Básico{{CompatChrome("38")}}{{CompatGeckoDesktop("25")}}{{CompatNo}}{{CompatOpera("25")}}{{CompatSafari("7.1")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracteristicaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte Básico{{CompatNo}}{{CompatNo}}{{CompatGeckoMobile("25")}}{{CompatNo}}{{CompatNo}}8
+
+ +

Vea Tambien

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