tf.math.pow
JavaScript | Math.pow()方法 (JavaScript | Math.pow() Method)
Math.pow() is a function in math library of JavaScript that is used to return the value of a number x to the power n (where, x is base and n is exponent.
Math.pow()是JavaScript数学库中的一个函数,用于将数字x的值返回到幂n (其中x为基数, n为指数)。
Syntax:
句法:
Math.pow(base, exponent);
Parameter(s):
参数:
base, exponent – represent the values of base and exponent.
base,exponent –表示base和exponent的值。
Return value:
返回值:
The return type of this method is number, it returns the value which is the result of base ^ exponent.
此方法的返回类型为number ,它返回作为base ^指数结果的值。
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.pow(5, 4));
console.log(Math.pow(3.14, 4));
console.log(Math.pow(0, 4, ));
console.log(Math.pow("0.65", "-3"));
Output
输出量
625
97.21171216000002
0
3.641329085116067
Example 2: Invalid values
示例2:无效值
Math.pow("Javascript", "IncludeHelp")
Output
输出量
NaN
翻译自: https://www.includehelp.com/code-snippets/math-pow-method-with-example-in-javascript>javascript.aspx
tf.math.pow