| 标题 | 标签 |
|---|---|
| nthRoot(n次方根) | math(数学) |
计算给定数字的 n 次方根。
- 使用 Math.pow() 计算 x 的 1 / n 次方,等于 x 的第 n 次方根。
const nthRoot = (x,n) => Math.pow(x,1 / n);调用方式:
nthRoot(32, 5); // 2应用场景
以下是一个实战示例:
结果如下:
<iframe src="codes/javascript/html/nth-root.html"></iframe>| 标题 | 标签 |
|---|---|
| nthRoot(n次方根) | math(数学) |
计算给定数字的 n 次方根。
const nthRoot = (x,n) => Math.pow(x,1 / n);调用方式:
nthRoot(32, 5); // 2应用场景
以下是一个实战示例:
结果如下:
<iframe src="codes/javascript/html/nth-root.html"></iframe>