SA-MP Forums Archive
What's meaning of this symbol? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What's meaning of this symbol? (/showthread.php?tid=491993)



What's meaning of this symbol? - AnonScripter - 02.02.2014

what is this symbol mean in pawno:
pawn Код:
%
some scripters use it in math just like * / + -


Re: What's meaning of this symbol? - anou1 - 02.02.2014

Isnt it "Modulo" ?
To give the rest of a division "/" ?


Re: What's meaning of this symbol? - UnClear - 02.02.2014

its procent lol just a different model


Re: What's meaning of this symbol? - Lordzy - 02.02.2014

It gives the reminder.
pawn Код:
new
    a = 10,
    b = 2;
printf("The reminder while dividing 10/2 is %d", a%b);
//Outputs 0

a = 3, b = 2;
printf("The reminder while dividing 3/2 is %d", a%b);
//Outputs 1


//A function example, whether if a number is odd or even.

stock bool:IsNumberOdd(number) {
    if((number % 2) == 0) return false;
    else return true;
}

Returns true if the number is odd, false if it's even.