博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JavaScript中带有示例的Math.log()方法
阅读量:2526 次
发布时间:2019-05-11

本文共 1266 字,大约阅读时间需要 4 分钟。

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.60943791243410031.144222799920162-Infinity-0.4307829160924542

Example 2: Invalid values

示例2:无效值

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

Output

输出量

NaNNaN

翻译自:

转载地址:http://gftzd.baihongyu.com/

你可能感兴趣的文章
阶段3 2.Spring_01.Spring框架简介_04.spring发展历程
查看>>
阶段3 2.Spring_02.程序间耦合_3 程序的耦合和解耦的思路分析1
查看>>
阶段3 2.Spring_02.程序间耦合_5 编写工厂类和配置文件
查看>>
阶段3 2.Spring_01.Spring框架简介_05.spring的优势
查看>>
阶段3 2.Spring_02.程序间耦合_7 分析工厂模式中的问题并改造
查看>>
阶段3 2.Spring_02.程序间耦合_4 曾经代码中的问题分析
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_2 spring中的Ioc前期准备
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_4 ApplicationContext的三个实现类
查看>>
阶段3 2.Spring_02.程序间耦合_8 工厂模式解耦的升级版
查看>>
阶段3 2.Spring_03.Spring的 IOC 和 DI_6 spring中bean的细节之三种创建Bean对象的方式
查看>>
阶段3 2.Spring_04.Spring的常用注解_3 用于创建的Component注解
查看>>
阶段3 2.Spring_04.Spring的常用注解_2 常用IOC注解按照作用分类
查看>>
阶段3 2.Spring_09.JdbcTemplate的基本使用_5 JdbcTemplate在spring的ioc中使用
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_02.ssm整合之搭建环境
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_3、快速创建SpringBoot应用之手工创建web应用...
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_04.ssm整合之编写SpringMVC框架
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_5、SpringBoot2.x的依赖默认Maven版本...
查看>>
阶段3 3.SpringMVC·_07.SSM整合案例_08.ssm整合之Spring整合MyBatis框架
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_9、SpringBoot基础HTTP其他提交方法请求实战...
查看>>
小D课堂 - 零基础入门SpringBoot2.X到实战_第2节 SpringBoot接口Http协议开发实战_12、SpringBoot2.x文件上传实战...
查看>>