of     3   
chevron_rightchevron_rightchevron_right

killajake25
#139305745Saturday, July 05, 2014 11:28 AM GMT

I recently started seeing % around. I looked online for the formula for it and I'm a little confused about it. But I was wondering what uses it could have? Can someone explain the formula for me? Thanks.
killajake25
#139305891Saturday, July 05, 2014 11:31 AM GMT

Title Fix: Use of % / Modulus?
warspyking
#139306104Saturday, July 05, 2014 11:36 AM GMT

Well it returns the remainder of division. For example 10 % 3 Well 3 goes into 10, 3 times; 3 + 3 + 3 = 9 If you add it again it'll be over 10, since there was 1 left over, the remainder is one, so 10 % 3 = 1
killajake25
#139351008Saturday, July 05, 2014 9:23 PM GMT

I think I understand. so; 15 % 4 = 3 4 + 4 + 4 = 12 15 - 12 = 3 Is that right? If so, where can I apply this to scripting?
warspyking
#139351536Saturday, July 05, 2014 9:29 PM GMT

Yes, exactly. You could check if a number is even; N = 5 if N % 2 == 0 then print("Number is even!") else print("Number is odd!") end Or you could use it for some sort of algorithm or even to check if a value had increase by +5 (I've seen leaderboards use it to award points)
killajake25
#139351792Saturday, July 05, 2014 9:32 PM GMT

Ahhh. I see. Thank you for the clarification! Checking whether a number is odd or even can be very useful in some cases, I'd imagine. Thanks. :)
warspyking
#139352604Saturday, July 05, 2014 9:40 PM GMT

For a few more practical uses; http://stackoverflow.com/questions/2609315/recognizing-when-to-use-the-modulus-operator
warspyking
#139357041Saturday, July 05, 2014 10:24 PM GMT

Then, not much more information, but this has more example; http://stackoverflow.com/questions/3589976/what-are-the-practical-uses-of-modulus-in-programming
warspyking
#139357394Saturday, July 05, 2014 10:28 PM GMT

The examples are in C# but there's here; http://watchhogstories.wordpress.com/2008/08/11/coding-practices-the-modulus-operator/
Lacryma
#139357714Saturday, July 05, 2014 10:31 PM GMT

You'll need it in many algorithms. Basic use is checking if a number is even or odd.
killajake25
#139357746Saturday, July 05, 2014 10:31 PM GMT

These are very useful, I'll be sure to track this for later use. Again, thank you!
Lacryma
#139357838Saturday, July 05, 2014 10:32 PM GMT

yw
warspyking
#139357862Saturday, July 05, 2014 10:32 PM GMT

Alright, that's all I could get out of the first page of a google search. Enough examples?
warspyking
#139357977Saturday, July 05, 2014 10:34 PM GMT

No problem, and ignore Duel, he's just restating what I said because he's 5 % 1 percent original XD
Lacryma
#139358033Saturday, July 05, 2014 10:34 PM GMT

"he's just restating what I said" coming from the guy who had to google it
warspyking
#139358755Saturday, July 05, 2014 10:43 PM GMT

I was googling EXAMPLES for him to check out, my explaination was from memory. Now, please leave before the OP gets 100 % 101 percent annoyed because of the fact you are 100 % 101 percent annoying.
Lacryma
#139359832Saturday, July 05, 2014 10:56 PM GMT

No you google'd the answer since you did not know it. Then you put examples to cover it up.
warspyking
#139360096Saturday, July 05, 2014 10:59 PM GMT

Took you a while to reply, had to get a calculator to figure out my equation? I'm surprised you could even work one.
Lacryma
#139360263Saturday, July 05, 2014 11:01 PM GMT

or maybe I have a life and am doing other things unlike you whose life revolves around roblox
warspyking
#139360431Saturday, July 05, 2014 11:03 PM GMT

That's sad, you have to insult me to cover up the fact that you can't script properly. You sir, belong in OT.
Lacryma
#139360515Saturday, July 05, 2014 11:04 PM GMT

lol, you're the one who told the OP to ignore me just because you have no knowledge on scripting/programming languages
warspyking
#139360763Saturday, July 05, 2014 11:07 PM GMT

The truth is, I replied first, not you, even though you claim you are a "regular" here. I provided examples, and that backed it up with other sources just incase he wanted to have some practical uses. Please, ask the OP who helped him. Do it. I dare you.
Lacryma
#139360870Saturday, July 05, 2014 11:08 PM GMT

the only reason you were able to help is due to the fact that you google'd it, you don't understand it at all, just like everything you post on here.
warspyking
#139361187Saturday, July 05, 2014 11:11 PM GMT

Duel you have no proof I cannot use % on my own, and you will never get any, know why? It's because I can. Now, let the thread die, "regular"
Lacryma
#139361338Saturday, July 05, 2014 11:13 PM GMT

"Duel you have no proof I cannot use % on my own" You have no proof that you were able to before.(You had to use other people's examples) "Now, let the thread die, "regular"" You want the thread to die because I'm right.

    of     3   
chevron_rightchevron_rightchevron_right