Explain this.
#1

pawn Код:
if(a % b)
what does it mean ? That % ?
Reply
#2

It stands for 'modulus'. Basically the number loops back to zero once it hits that number; that test is testing whether the answer is more than 0, meaning, in pseudo-code:

if(a is not a multiple of b){
DO THIS;
}

23 % 2 = 1
25 % 5 = 0
80 % 9 = 8

Etcetera.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)