math.pow()

类型 函数
math.*
返回值 数字
修订 2024.3703 版
关键字 pow、幂、指数
另请参见 math.exp()
math.log()

概述

返回 x^y^。(你还可以使用表达式 x^y 来计算此值。)

语法

math.pow( x, y )
x (必填)

数字基础。

y (必填)

数字指数。

示例

print(math.pow(100,0))  ---->  1
print(math.pow(7,2))    ---->  49
print(math.pow(2,8))    ---->  256