Skip to content

Instantly share code, notes, and snippets.

@balaam
Created July 30, 2015 03:54
Show Gist options
  • Select an option

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

Select an option

Save balaam/2850821296a924d81af4 to your computer and use it in GitHub Desktop.
Lua code for a fractional function.
function frac(v)
return v - math.floor(v)
end
print(1.6, frac(1.6))
print(2.0, frac(2.0))
print(1356.9999, frac(1356.9999))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment