Created
July 30, 2015 03:54
-
-
Save balaam/2850821296a924d81af4 to your computer and use it in GitHub Desktop.
Lua code for a fractional function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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