[ Update ] 1. A bit dumb way, it takes more time to store variables, so I use functions :P 2. "n mod 1" is faster than "n - floor(n)"