Answers for "lua wrap number"

Lua
2

lua wrap number

local function wrap(x_max, x_min, x)
  return (((x - x_min) % (x_max - x_min)) + (x_max - x_min)) % (x_max - x_min) + x_min;
end
Posted by: Guest on September-28-2020

Browse Popular Code Answers by Language