9 lines
117 B
Lua
9 lines
117 B
Lua
|
function math.sign(x)
|
||
|
if x<0 then
|
||
|
return -1
|
||
|
elseif x>0 then
|
||
|
return 1
|
||
|
else
|
||
|
return 0
|
||
|
end
|
||
|
end
|