Math.powf
Math.powf
功能
Math.powf 是 Math.pow 的兼容别名,用于计算 value 的 power 次幂。
语法
Math.powf(value, power)
参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| value | Number | 是 | 无 | 底数。 |
| power | Number | 是 | 无 | 指数。 |
返回值
| 类型 | 说明 |
|---|---|
| Int/Float | 返回 value 的 power 次幂;整数结果返回 Int,非整数或非有限结果返回 Float。 |
示例
result = Math.powf(2, 3) // 输出:8 print result
注意事项
- 新代码建议使用 Math.pow。