Math.log10()
Math.log10() 静态方法返回数字的以 10 为底的对数。那是
¥The Math.log10() static method returns the base 10 logarithm of a number. That is
Try it
语法
参数
返回值
描述
¥Description
因为 log10() 是 Math 的静态方法,所以你始终将其用作 Math.log10(),而不是用作你创建的 Math 对象的方法(Math 不是构造函数)。
¥Because log10() is a static method of Math, you always use it as Math.log10(), rather than as a method of a Math object you created (Math is not a constructor).
该功能相当于 Math.log(x) / Math.log(10)。对于 log10(e),使用常量 Math.LOG10E,即 1 / Math.LN10。
¥This function is the equivalent of Math.log(x) / Math.log(10). For log10(e), use the constant Math.LOG10E, which is 1 / Math.LN10.
示例
使用 Math.log10()
规范
| Specification |
|---|
| ECMAScript Language Specification # sec-math.log10 |
浏览器兼容性
BCD tables only load in the browser