JavaScript | Math.log()方法 (JavaScript | Math.log() Method)

Math.log() is a function in math library of JavaScript that is used to return the value of natural Log i.e. (base e) of the given number. It is also known as ln(x) in mathematical terms.

Math.log()是JavaScript数学库中的函数,用于返回给定数字的自然Log值(即e的底数 )。 它在数学上也称为ln(x)

Syntax:

句法:

    Math.log(value);

Parameter(s):

参数:

  • value – It represents the value for which natural log is to be found.

    值 –它表示要找到自然对数的值。

Return value:

返回值:

The return type of this method is number, it returns a number value which is loge(value).

此方法的返回类型为number ,它返回一个数字值log e (值)

Values accepted: Integer, floating-point, numeric string.

接受的值:整数,浮点数,数字字符串。

Invalid Values: non-numeric string, empty variable, empty array all will return NaN (Not a Number).

无效值:非数字字符串,空变量,空数组都将返回NaN(非数字)。

Browser support: Chrome, Internet asinlorer, Mozilla, Safari, Opera mini.

浏览器支持: Chrome,Internet代理,Mozilla,Safari,Opera mini。

Example 1: Valid values

示例1:有效值

console.log(Math.log(5));
console.log(Math.log(3.14));
console.log(Math.log(0));
console.log(Math.log("0.65"));

Output

输出量

1.6094379124341003
1.144222799920162
-Infinity
-0.4307829160924542

Example 2: Invalid values

示例2:无效值

console.log(Math.log("Javascript"));
console.log(Math.log(-1));

Output

输出量

NaN
NaN

翻译自: https://www.includehelp.com/code-snippets/math-log-method-with-example-in-javascript.aspx

JavaScript中带有示例的Math.log()方法相关推荐

  1. JavaScript中带有示例的Math.log10()方法

    JavaScript | Math.log10()方法 (JavaScript | Math.log10() Method) Math operations in JavaScript are han ...

  2. JavaScript中带有示例的Math.abs()方法

    JavaScript | Math.abs()方法 (JavaScript | Math.abs() Method) Math operations in JavaScript are handled ...

  3. JavaScript中带有示例的Math.max()方法

    JavaScript | Math.max()方法 (JavaScript | Math.max() Method) Math.max() is a function in math library ...

  4. JavaScript中带有示例的Math.round()方法

    JavaScript | Math.round()方法 (JavaScript | Math.round() Method) Math.round() is a function in math li ...

  5. JavaScript中带有示例的Math.cos()方法

    JavaScript | Math.cos()方法 (JavaScript | Math.cos() Method) Math.cos() is a function in math library ...

  6. JavaScript中带有示例的Math.PI属性

    JavaScript | Math.PI属性 (JavaScript | Math.PI Property) Math.PI is a property in math library of Java ...

  7. math.sqrt 有问题_JavaScript中带有示例的Math.sqrt()方法

    math.sqrt 有问题 JavaScript | Math.sqrt()方法 (JavaScript | Math.sqrt() Method) The Math.sqrt() method is ...

  8. 1507四舍五入c语言,JavaScript中用于四舍五入的Math.round()方法讲解

    此方法返回一个数四舍五入为最接近的整数的值. 语法 Math.round( x ) ; 下面是参数的详细信息: x: 一个数字 返回值: 返回数字四舍五入为最接近的整数的值. 例子: JavaScri ...

  9. math.ceil带小数点_JavaScript中带有示例的Math.ceil()方法

    math.ceil带小数点 JavaScript | Math.ceil()方法 (JavaScript | Math.ceil() Method) Math.ceil() is a function ...

最新文章

  1. 数值分析第五版电子版_二年级上册数学重点必考题20道,看看不吃亏!【有电子版】...
  2. 飞鸽传书(IPMSG)的主要工作原理
  3. 职业生涯设计的10点忠告
  4. movelast对数据记录数有要求吗_客户验厂,电脑坏了,考勤记录数据可以自动生成找回来吗?...
  5. 查找元器件_电子元器件-常用电子元器件基础知识大全
  6. 通过web的方式动态查看tomcat的catalina.out的日志(web.py)
  7. [C#] 计算大文件的MD5的两种方式(直接调用方法计算,流计算-适用于大文件)
  8. jQuery源码阅读
  9. 10 个超棒的 jQuery 视频插件
  10. FullScreen
  11. 深度学习中的迁移学习介绍
  12. 第29章基于锁的并发数据结构
  13. c#语言中if语句多条件,关于C# if语句中并列条件的执行
  14. 调用微信二维码识别开源库
  15. Camera Log 关键字汇总
  16. Causal Reasoning from Meta-reinforcement Learning(自用笔记)
  17. 阿里灵狐插件与IDEA的集成
  18. 计算空间中两线段之间的距离
  19. 文件隐藏的几种简单方法
  20. 转自:今天我们怎样学软件技术,怎样教软件课程?——作者:金旭亮

热门文章

  1. 排序千万级数据_从千万级房产成交量排名,窥探中国城市的真实家底
  2. Oracle闪回报错,oracle 闪回区满了,ORA-19815
  3. 小马源码_Java互联网架构-重新认识Java8-HashMap-不一样的源码解读
  4. gradle 查看依赖类库版本_Android studio中查看依赖的第三方库的历史版本和最新版本...
  5. python获取软件窗口句柄_Python获取浏览器窗口句柄过程解析
  6. html页面怎么加向下滚动,如何使用jQuery向上或向下滚动页面到锚点?
  7. python列表生成器语法_python列表生产式和生成器
  8. ②你真的学会Java了吗?来自《卷Ⅰ》的灵魂提问
  9. mysql数据库参数
  10. Linux环境下Flume的安装