Wow! I've been going through Stack Overflow and MDN trying to find deeper explanations on this and so far yours is the best breakdown I've seen. The way you explained it definitely makes more sense. So using another example via your method..
26 % 8 = x
26 - (floor(26/8) * 8 = x
26 - (floor(3.25) * 8 = x
26 - (3 * 8) = x
26 - 24 = 2
You can think of modulo like so.
where floor means round down
More generic example
So let's do a random one
34 % 14
I don't know if this helps or not 🙂
Wow! I've been going through Stack Overflow and MDN trying to find deeper explanations on this and so far yours is the best breakdown I've seen. The way you explained it definitely makes more sense. So using another example via your method..
26 % 8 = x
26 - (floor(26/8) * 8 = x
26 - (floor(3.25) * 8 = x
26 - (3 * 8) = x
26 - 24 = 2
Is that correct?
Thank you so much for your help!
Yep that's correct, well done 🙂
Glad I could help.