mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 23:41:50 +00:00
add math.sign
This commit is contained in:
parent
a0b7e81a94
commit
a1a5d390c4
1 changed files with 4 additions and 0 deletions
|
|
@ -35,3 +35,7 @@ function math.sum(...)
|
||||||
|
|
||||||
return sum
|
return sum
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function math.sign(x)
|
||||||
|
return (x > 0) and 1 or (x < 0 and -1 or 0)
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue