np.expm1_JavaScript中带有示例的Math.expm1()方法

np.expm1

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

Math operations in JavaScript are handled using functions of math library in JavaScript. In this tutorial on Math.expm1() method, we will learn about the expm1() method and its working with examples.

JavaScript中的数学运算是使用JavaScript中的数学库函数处理的。 在有关Math.expm1()方法的本教程中,我们将学习expm1()方法及其示例。

Math.expm1() is a function in math library of JavaScript that is used to support math's operation of ep-1 of a number p. Where, e is a mathematical constant with value 2.718.

Math.expm1()是JavaScript数学库中的一个函数,用于支持数字pe p -1的数学运算。 其中, e是一个数学常数,值为2.718

Syntax:

句法:

    Math.expm1(p);

Parameter(s):

参数:

  • p – It takes only one value which is the number.

    p –仅采用一个值即数字。

Return value:

返回值:

The return type of this method is number, it returns the result of the expression ep-1.

该方法的返回类型为number ,它返回表达式e p -1的结果。

Example 1:

范例1:

console.log(Math.expm1(0))

Output

输出量

0

The value of e0 - 1 = 0

e 0-1 = 0的值

Example 2: printing valid results for the function

示例2:为该函数打印有效结果

console.log(Math.expm1(2))
console.log(Math.expm1(2.32))
console.log(Math.expm1(-5))
console.log(Math.expm1(Math.log10(43)))

Output

输出量

6.38905609893065
9.175674306073333
-0.9932620530009145
4.121608017082989

Example 2: Tring values that will provide invalid results for the function.

示例2:Tring值将为该函数提供无效的结果。

console.log(Math.expm1(C))
/*Uncaught ReferenceError: C is not defined
    at <anonymous>:1:24*/

console.log(Math.expm1("include help"))
/*NaN*/


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

np.expm1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值