Skip to content

Instantly share code, notes, and snippets.

@balaam
Created August 22, 2012 14:56
Show Gist options
  • Select an option

  • Save balaam/3426413 to your computer and use it in GitHub Desktop.

Select an option

Save balaam/3426413 to your computer and use it in GitHub Desktop.
Wrap a number in the range 0-1. e.g. 1.3 becomes 0.3
function WrapZeroOne(value)
value = value - math.floor(value)
if value < 0 then
x = x + 1
end
return value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment