这个 数学cbrt() 函数用于查找数字的立方根。 数字的立方根表示为数学。cbrt(x)=y使得y^3=x。
null
语法:
Math.cbrt(number)
使用的参数: 编号: 这是你想知道谁的房间号码。
返回值: 它返回给定数字的立方根。
例如:
Input : Math.cbrt(8) Output : 2 Input : Math.cbrt(-8) Output : -2 Input : Math.cbrt(0) Output : 0 Input : Math.cbrt(infinity) Output : Infinity
- 当正数作为参数传递时。
<
script
type
=
"text/javascript"
>
document.write("Output : " + Math.cbrt(8));
</
script
>
输出:
Output : 2
- 当一个负数作为参数传递时。
<
script
type
=
"text/javascript"
>
document.write("Output : " + Math.cbrt(-8));
</
script
>
输出:
Output : -2
- 当零作为参数传递时。
<
script
type
=
"text/javascript"
>
document.write("Output : " + Math.cbrt(0));
</
script
>
输出:
Output : 0
- 当无穷大作为参数传递时。
<
script
type
=
"text/javascript"
>
document.write("Output : " + Math.cbrt(infinity));
</
script
>
输出:
Output : Infinity
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END