类型 函数 库 math.* 返回值 数字 修订 版本 2024.3703 关键词 abs, 绝对值
返回 x
的绝对值(幅度)。
math.abs( x )
数字。一个数字。
local a = math.abs(153) -- Sets a to 153 local b = math.abs(-15) -- Sets b to 15 local c = math.abs(12.234) -- Sets c to 12.234 local d = math.abs(-9.23) -- Sets d to 9.23