I dont know what meaning of this symbol - %.

for example,

buttonPressCount % numberOfLED == i

I hope anyone can tell me the name and basic function of this symbol.

  • I don't understand why this question was modded down so I gave it a point. – deltaray May 26 '17 at 23:19

It is called the modulus operator, and it performs the modulo operation.

TL;CBR: It results in the remainder after division is performed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.