iMr.WiFi..! Posted August 23, 2017 Share Posted August 23, 2017 hello , i have question about "%" on coding .. I use it sometimes but i didn't understand Its usefulness .. anyone can explain me what is its usefulness ? 1 Link to comment
Administrators Lpsd Posted August 23, 2017 Administrators Share Posted August 23, 2017 % is modulo. It gives you the remainder from a division 2 % 1 = 0 3 % 2 = 1 50 % 23 = 4 and so on Link to comment
iMr.WiFi..! Posted August 23, 2017 Author Share Posted August 23, 2017 25 minutes ago, LopSided_ said: % is modulo. It gives you the remainder from a division 2 % 1 = 0 3 % 2 = 1 50 % 23 = 4 and so on i understand it before your comment, however thanks for helping .. Link to comment
Moderators IIYAMA Posted August 24, 2017 Moderators Share Posted August 24, 2017 It is very useful for repeating (dx) animations. local duration = 4000 -- ms local progress = getTickCount() % duration / duration -- progress 0 t/m 1 3 Link to comment
iMr.WiFi..! Posted August 25, 2017 Author Share Posted August 25, 2017 10 hours ago, IIYAMA said: It is very useful for repeating (dx) animations. local duration = 4000 -- ms local progress = getTickCount() % duration / duration -- progress 0 t/m 1 Good example, wow ! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now